Skip to content

Commit

Permalink
fix: lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Jan 9, 2024
1 parent 8a2e95e commit 4808bd0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ func Execute() {

func init() {
rootCmd.Flags().StringVar(&token, "token", "", "github api token (default $GITHUB_TOKEN)")
rootCmd.MarkFlagRequired(token)
_ = rootCmd.MarkFlagRequired(token)

rootCmd.Flags().StringVarP(&organization, "org", "o", "", "github organization to scan")
rootCmd.MarkFlagRequired("org")
_ = rootCmd.MarkFlagRequired("org")

rootCmd.Flags().StringSliceVarP(&blacklist, "blacklist", "b", []string{}, "blacklist repos and/or users")
rootCmd.Flags().IntVar(&top, "top", 3, "how many users to show")
Expand Down Expand Up @@ -72,12 +72,12 @@ Important notes:
* The ` + "`--since`" + ` option accepts all the regular time. Accepts any duration Go standard library accepts, plus a few more: 1y (365d), 1mo (30d), 1w (7d) and 1d (24h).
* The ` + "`--token`" + ` token permissions need to include 'repo - Full control of private repositories'. Required only if you need to fetch data from private repositories in your organization.
}`,
PreRun: func(cmd *cobra.Command, args []string) {
PreRun: func(*cobra.Command, []string) {
if token == "" {
token = os.Getenv("GITHUB_TOKEN")
}
},
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(*cobra.Command, []string) error {
ctx := context.Background()
client, err := newClient(ctx, token, githubURL)
if err != nil {
Expand All @@ -91,7 +91,7 @@ Important notes:

userBlacklist, repoBlacklist := buildBlacklists(blacklist)

var csv io.Writer = io.Discard
csv := io.Discard
if csvPath != "" {
if err := os.MkdirAll(filepath.Dir(csvPath), 0o755); err != nil {
return fmt.Errorf("failed to create csv file: %w", err)
Expand Down Expand Up @@ -126,6 +126,7 @@ Important notes:
excludeForks,
csv,
))
return p.Start()
_, err = p.Run()
return err
},
}
4 changes: 2 additions & 2 deletions cmd/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func NewInitialModel(
excludeForks bool,
csv io.Writer,
) InitialModel {
var s = spinner.NewModel()
s := spinner.New()
s.Spinner = spinner.MiniDot
s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("205"))

Expand Down Expand Up @@ -76,7 +76,7 @@ func (m InitialModel) Init() tea.Cmd {
m.includeReviewStats,
m.excludeForks,
),
spinner.Tick,
m.spinner.Tick,
)
}

Expand Down

0 comments on commit 4808bd0

Please sign in to comment.