mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-06 11:28:49 -04:00
fix: combination of --fix and --path-prefix (#3700)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
parent
076f6b911d
commit
d92b38cc3e
4 changed files with 70 additions and 20 deletions
pkg/commands
|
@ -23,7 +23,6 @@ import (
|
|||
"github.com/golangci/golangci-lint/pkg/packages"
|
||||
"github.com/golangci/golangci-lint/pkg/printers"
|
||||
"github.com/golangci/golangci-lint/pkg/result"
|
||||
"github.com/golangci/golangci-lint/pkg/result/processors"
|
||||
)
|
||||
|
||||
const defaultFileMode = 0644
|
||||
|
@ -360,18 +359,12 @@ func (e *Executor) runAnalysis(ctx context.Context, args []string) ([]result.Iss
|
|||
lintCtx.Log = e.log.Child(logutils.DebugKeyLintersContext)
|
||||
|
||||
runner, err := lint.NewRunner(e.cfg, e.log.Child(logutils.DebugKeyRunner),
|
||||
e.goenv, e.EnabledLintersSet, e.lineCache, e.DBManager, lintCtx.Packages)
|
||||
e.goenv, e.EnabledLintersSet, e.lineCache, e.fileCache, e.DBManager, lintCtx.Packages)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
issues, err := runner.Run(ctx, lintersToRun, lintCtx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
fixer := processors.NewFixer(e.cfg, e.log, e.fileCache)
|
||||
return fixer.Process(issues), nil
|
||||
return runner.Run(ctx, lintersToRun, lintCtx)
|
||||
}
|
||||
|
||||
func (e *Executor) setOutputToDevNull() (savedStdout, savedStderr *os.File) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue