mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-13 06:48:43 -04:00
dev: clean context loader (#4480)
This commit is contained in:
parent
1aa28ec6a4
commit
6fda81008d
3 changed files with 75 additions and 82 deletions
pkg/commands
|
@ -363,19 +363,18 @@ func (c *runCommand) runAnalysis(ctx context.Context, args []string) ([]result.I
|
|||
c.reportData.AddLinter(lc.Name(), isEnabled, lc.EnabledByDefault)
|
||||
}
|
||||
|
||||
lintCtx, err := c.contextLoader.Load(ctx, lintersToRun)
|
||||
lintCtx, err := c.contextLoader.Load(ctx, c.log.Child(logutils.DebugKeyLintersContext), lintersToRun)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("context loading failed: %w", err)
|
||||
}
|
||||
lintCtx.Log = c.log.Child(logutils.DebugKeyLintersContext)
|
||||
|
||||
runner, err := lint.NewRunner(c.log.Child(logutils.DebugKeyRunner),
|
||||
c.cfg, c.goenv, c.lineCache, c.fileCache, c.dbManager, lintCtx.Packages)
|
||||
c.cfg, c.goenv, c.lineCache, c.fileCache, c.dbManager, lintCtx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return runner.Run(ctx, lintersToRun, lintCtx)
|
||||
return runner.Run(ctx, lintersToRun)
|
||||
}
|
||||
|
||||
func (c *runCommand) setOutputToDevNull() (savedStdout, savedStderr *os.File) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue