You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After changing some linter settings, we began seeing that the linter was
failing to run on v6 (when the "V7" build tag was not given). The errors
were complaining about duplicate declarations in the "fixtures/plugins"
directory (which was meant to be ignored by the linter, via the
"skip-dirs" option).
After investigating, I learned that Golangci-lint will still try to
parse and analyze directories that are skipped in this way - it only
uses the "skip-dirs" option to filter out any lint errors that are found
after analysis is complete. Here's an open GitHub issue about this:
golangci/golangci-lint#301
This means that if there are compilation errors in these skipped dirs,
they will fail the linter, even though we want to skip them.
I'm fixing this with a workaround suggested in that issue. Something
like:
```
go list ./... | (grep for dirs you care to lint) | xargs golangci-lint
run
```
A nice side effect is that, by truly skipping analysis of these dirs,
the linter runs faster.
[#172389465]
Authored-by: Reid Mitchell <[email protected]>
0 commit comments