<commit_before>package command

import (
	"fmt"

	"github.com/spf13/cobra"
)

type listOptions struct {
	isQuiet              bool
	isOneLiner           bool
	isIncldeCreationTime bool
}

// NewListCommand returns definition of command list
func NewListCommand(cli *ManagerCli) *cobra.Command {
	opts := listOptions{}

	cmd := &cobra.Command{
		Use:   "list",
		Short: "List pull requests",
		RunE: func(cmd *cobra.Command, args []string) error {
			if len(args) != 0 {
				cli.ShowHelp(cmd, args)
				return nil
			}
			return runList(cli, opts)
		},
	}

	flags := cmd.Flags()
	flags.BoolVarP(&opts.isQuiet, "quiet", "q", false, "List IDs only")
	flags.BoolVar(&opts.isOneLiner, "oneline", false, "List in oneliners")
	flags.BoolVar(&opts.isIncldeCreationTime, "created-time", false, "Include created time")

	return cmd
}

func runList(cli *ManagerCli, opts listOptions) error {
	client := cli.Client()
	cred := cli.UserCredential()
	repo := cli.Repo()

	prList, err := client.ListRequests(cred, repo)
	if err != nil {
		return err
	}

	if len(prList) == 0 {
		fmt.Println("There are no open pull requests.")
		return nil
	}

	for _, pr := range prList {
		prInfo, _ := client.GetRequest(cred, repo, pr.ID)
		printFunc := getPrint(prInfo, cred)
		if opts.isQuiet {
			printFunc("%d", prInfo.ID)
		} else if opts.isOneLiner {
			printFunc(prInfo.ToOneLiner())
		} else {
			printFunc(prInfo.ToShortDescription(opts.isIncldeCreationTime))
		}
	}
	return nil
}<commit_msg>Added option to hide PR by current user to list command<commit_after>package command

import (
	"fmt"

	"github.com/spf13/cobra"
)

type listOptions struct {
	isQuiet                     bool
	isOneLiner                  bool
	isIncldeCreationTime        bool
	isHideAuthoredByCurrentUser bool
}

// NewListCommand returns definition of command list
func NewListCommand(cli *ManagerCli) *cobra.Command {
	opts := listOptions{}

	cmd := &cobra.Command{
		Use:   "list",
		Short: "List pull requests",
		RunE: func(cmd *cobra.Command, args []string) error {
			if len(args) != 0 {
				cli.ShowHelp(cmd, args)
				return nil
			}
			return runList(cli, opts)
		},
	}

	flags := cmd.Flags()
	flags.BoolVarP(&opts.isQuiet, "quiet", "q", false, "List IDs only")
	flags.BoolVar(&opts.isOneLiner, "oneline", false, "List in oneliners")
	flags.BoolVar(
		&opts.isIncldeCreationTime, "created-time", false, "Include created time")
	flags.BoolVarP(
		&opts.isHideAuthoredByCurrentUser,
		"hide-current", "c", false, "Hide pull requests created by current user")

	return cmd
}

func runList(cli *ManagerCli, opts listOptions) error {
	client := cli.Client()
	cred := cli.UserCredential()
	repo := cli.Repo()

	prList, err := client.ListRequests(cred, repo)
	if err != nil {
		return err
	}

	if len(prList) == 0 {
		fmt.Println("There are no open pull requests.")
		return nil
	}

	for _, pr := range prList {
		if opts.isHideAuthoredByCurrentUser {
			if pr.Author.Username == cred.Username {
				continue
			}
		}
		prInfo, _ := client.GetRequest(cred, repo, pr.ID)
		printFunc := getPrint(prInfo, cred)
		if opts.isQuiet {
			printFunc("%d", prInfo.ID)
		} else if opts.isOneLiner {
			printFunc(prInfo.ToOneLiner())
		} else {
			printFunc(prInfo.ToShortDescription(opts.isIncldeCreationTime))
		}
	}
	return nil
}
{'fraction_non_alphanumeric': 0.1293471629042099, 'fraction_numerical': 0.0024405125076266015, 'mean_word_length': 3.6248236953455573, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1404500', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1162, 'n_words': 287}