Skip to content

Commit 983bbe2

Browse files
Put context.Context as first parameter per Go convention
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a940ed3 commit 983bbe2

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

command/issues/issues.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func NewCmdIssuesWithDeps(deps *cmddeps.Deps) *cobra.Command {
9292
Short: "View issues in a repository",
9393
Long: doc,
9494
RunE: func(cmd *cobra.Command, _ []string) error {
95-
return opts.Run(cmd, cmd.Context())
95+
return opts.Run(cmd.Context(), cmd)
9696
},
9797
}
9898

@@ -239,7 +239,7 @@ func (opts *IssuesOptions) initClientAndConfig(cmd *cobra.Command) (*deepsource.
239239
return client, remote, nil
240240
}
241241

242-
func (opts *IssuesOptions) Run(cmd *cobra.Command, ctx context.Context) error {
242+
func (opts *IssuesOptions) Run(ctx context.Context, cmd *cobra.Command) error {
243243
client, remote, err := opts.initClientAndConfig(cmd)
244244
if err != nil {
245245
return err

command/metrics/metrics.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func NewCmdMetricsWithDeps(deps *cmddeps.Deps) *cobra.Command {
8787
Short: "View repository metrics",
8888
Long: doc,
8989
RunE: func(cmd *cobra.Command, _ []string) error {
90-
return opts.Run(cmd, cmd.Context())
90+
return opts.Run(cmd.Context(), cmd)
9191
},
9292
}
9393

@@ -116,7 +116,7 @@ func NewCmdMetricsWithDeps(deps *cmddeps.Deps) *cobra.Command {
116116
return cmd
117117
}
118118

119-
func (opts *MetricsOptions) Run(cmd *cobra.Command, ctx context.Context) error {
119+
func (opts *MetricsOptions) Run(ctx context.Context, cmd *cobra.Command) error {
120120
var cfgMgr *config.Manager
121121
if opts.deps != nil && opts.deps.ConfigMgr != nil {
122122
cfgMgr = opts.deps.ConfigMgr

command/reportcard/reportcard.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func NewCmdReportCardWithDeps(deps *cmddeps.Deps) *cobra.Command {
7979
Short: "View repository report card",
8080
Long: doc,
8181
RunE: func(cmd *cobra.Command, _ []string) error {
82-
return opts.Run(cmd, cmd.Context())
82+
return opts.Run(cmd.Context(), cmd)
8383
},
8484
}
8585

@@ -142,7 +142,7 @@ func (opts *ReportCardOptions) initClientAndRemote(cmd *cobra.Command) (*deepsou
142142
return client, remote, nil
143143
}
144144

145-
func (opts *ReportCardOptions) Run(cmd *cobra.Command, ctx context.Context) error {
145+
func (opts *ReportCardOptions) Run(ctx context.Context, cmd *cobra.Command) error {
146146
client, remote, err := opts.initClientAndRemote(cmd)
147147
if err != nil {
148148
return err

command/runs/runs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func NewCmdRunsWithDeps(deps *cmddeps.Deps) *cobra.Command {
7676
RunE: func(cmd *cobra.Command, _ []string) error {
7777
if opts.commitOid != "" {
7878
opts.commitOid = cmdutil.ResolveCommitOid(opts.commitOid)
79-
return opts.runDetail(cmd, cmd.Context())
79+
return opts.runDetail(cmd.Context(), cmd)
8080
}
8181
return opts.runList(cmd)
8282
},
@@ -195,7 +195,7 @@ func (opts *RunsOptions) fetchRuns(client *deepsource.Client) ([]runstypes.Analy
195195
}
196196

197197
// runDetail fetches and displays metadata + issues summary for a single commit.
198-
func (opts *RunsOptions) runDetail(cmd *cobra.Command, ctx context.Context) error {
198+
func (opts *RunsOptions) runDetail(ctx context.Context, cmd *cobra.Command) error {
199199
var cfgMgr *config.Manager
200200
if opts.deps != nil && opts.deps.ConfigMgr != nil {
201201
cfgMgr = opts.deps.ConfigMgr

command/vulnerabilities/vulnerabilities.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func NewCmdVulnerabilitiesWithDeps(deps *cmddeps.Deps) *cobra.Command {
8989
Short: "View dependency vulnerabilities",
9090
Long: doc,
9191
RunE: func(cmd *cobra.Command, _ []string) error {
92-
return opts.Run(cmd, cmd.Context())
92+
return opts.Run(cmd.Context(), cmd)
9393
},
9494
}
9595

@@ -122,7 +122,7 @@ func NewCmdVulnerabilitiesWithDeps(deps *cmddeps.Deps) *cobra.Command {
122122
return cmd
123123
}
124124

125-
func (opts *VulnerabilitiesOptions) Run(cmd *cobra.Command, ctx context.Context) error {
125+
func (opts *VulnerabilitiesOptions) Run(ctx context.Context, cmd *cobra.Command) error {
126126
var cfgMgr *config.Manager
127127
if opts.deps != nil && opts.deps.ConfigMgr != nil {
128128
cfgMgr = opts.deps.ConfigMgr

0 commit comments

Comments
 (0)