New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support --disable-default-skip-dirs #343
Comments
hi, thank you for reporting! |
Thanks @jirfag - just to be clear, you're proposing some sort of Not sure I totally understand what you mean by "our tests" - do you mean the unit tests for this package or something else? Once we agree on the right pathway forward I am happy to help drive the solution, if needed. |
Yes, something like |
Another use case: We have a number of things in a |
Just hit this issue with |
Also, the documentation says that |
To make them smaller, and as a workaround for golangci/golangci-lint#343 (comment).
To make them smaller, and as a workaround for golangci/golangci-lint#343 (comment).
hi, |
We are using
golangci-lint
to lint our ~320k LOC go monorepo. We have some logic set up to lint files in the monorepo that change on a given diff. You can imagine it does something to the effect ofgit diff
in order to compute a list of changed packages, and then passes these togolang-ci-lint
.But there are some packages that we do not want to lint, e.g. for historical / legacy / transition reasons. Using the
new
option is not a solution to our use cases in CI. Hence why we have some custom tooling around this.golangci-lint/pkg/result/processors/skip_dirs.go
Lines 85 to 90 in 658f4ad
The current behavior of
skip-dirs
is to not skip any explicitly specified package as a command line argument that conflicts with theskip-dirs
configuration.The following is a minimal reproducible case:
Silently linting the directory even though it is explicitly skipped in the configuration is very surprising behavior. At minimum, I would expect a warning to be printed when this case is encountered, since it seems to indicate a configuration error.
Our hack around this for now is to put the excluded packages into the
skip-files
option, which does not suffer from this unexpected behavior. An alternative would be to prevent the directories from being passed into the linter... but that seems to bring into question the point of this configuration option at all...@jirfag I am wondering why this behavior is the desired default. Is this something we can change? If not, would strongly advocate for a warning to be printed on this code path.
The text was updated successfully, but these errors were encountered: