Skip to content

Commit a5e2fd8

Browse files
authored
dev: remove Run.Args (#4525)
1 parent d37a3e0 commit a5e2fd8

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

pkg/commands/run.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,6 @@ func (c *runCommand) runAndPrint(ctx context.Context, args []string) error {
369369

370370
// runAnalysis executes the linters that have been enabled in the configuration.
371371
func (c *runCommand) runAnalysis(ctx context.Context, args []string) ([]result.Issue, error) {
372-
c.cfg.Run.Args = args
373-
374372
lintersToRun, err := c.dbManager.GetOptimizedLinters()
375373
if err != nil {
376374
return nil, err
@@ -381,8 +379,8 @@ func (c *runCommand) runAnalysis(ctx context.Context, args []string) ([]result.I
381379
return nil, fmt.Errorf("context loading failed: %w", err)
382380
}
383381

384-
runner, err := lint.NewRunner(c.log.Child(logutils.DebugKeyRunner),
385-
c.cfg, c.goenv, c.lineCache, c.fileCache, c.dbManager, lintCtx)
382+
runner, err := lint.NewRunner(c.log.Child(logutils.DebugKeyRunner), c.cfg, args,
383+
c.goenv, c.lineCache, c.fileCache, c.dbManager, lintCtx)
386384
if err != nil {
387385
return nil, err
388386
}

pkg/config/run.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ type Run struct {
3333

3434
// Deprecated: use Output.ShowStats instead.
3535
ShowStats bool `mapstructure:"show-stats"`
36-
37-
// Only used by skipDirs processor. TODO(ldez) remove it in next PR.
38-
Args []string // Internal needs.
3936
}
4037

4138
func (r *Run) Validate() error {

pkg/lint/runner.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type Runner struct {
3232
Processors []processors.Processor
3333
}
3434

35-
func NewRunner(log logutils.Log, cfg *config.Config, goenv *goutil.Env,
35+
func NewRunner(log logutils.Log, cfg *config.Config, args []string, goenv *goutil.Env,
3636
lineCache *fsutils.LineCache, fileCache *fsutils.FileCache,
3737
dbManager *lintersdb.Manager, lintCtx *linter.Context,
3838
) (*Runner, error) {
@@ -51,7 +51,7 @@ func NewRunner(log logutils.Log, cfg *config.Config, goenv *goutil.Env,
5151
skipDirs = append(skipDirs, packages.StdExcludeDirRegexps...)
5252
}
5353

54-
skipDirsProcessor, err := processors.NewSkipDirs(skipDirs, log.Child(logutils.DebugKeySkipDirs), cfg.Run.Args, cfg.Output.PathPrefix)
54+
skipDirsProcessor, err := processors.NewSkipDirs(skipDirs, log.Child(logutils.DebugKeySkipDirs), args, cfg.Output.PathPrefix)
5555
if err != nil {
5656
return nil, err
5757
}

0 commit comments

Comments
 (0)