-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Should skip_dirs skip analyzing, not just reporting? #4084
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
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
hello,
|
Well, there is not even my code in this case. I have https://github.com/cncf/xds in the third-party directory, and there are some .cc files that give this error:
Although I have this as a git submodule in my repo, I do not have control over all the files that are present there, so it seems logical to have the option to ignore them completely I can run golangci-lint and specify only dirs that contain my source code, but I feel like it would be nice to have option to avoid the directory completely. And thank you so much for what you are doing, Ludovic. |
Same question was asked here https://stackoverflow.com/questions/59857704/golangci-lint-want-to-really-ignore-a-go-file-not-simply-analyse-it-and-supp |
If they are required to compile, you cannot skip those files. Also, the tricks used by syzkaller work only because the files are not required to compile: the files use an "external" function to fill something outside of the files themself, they are independent and don't impact the compilation. The code should compile, it's not an option. The real question is: why do you use a submodule instead of just importing the dependency (and use vendoring if you want to keep a local copy)? |
Thanks for the comment.
Or such invocation can cause some problems, e.g. missing linting problems? And I will check if we can switch to vendoring, thanks for the suggestion! |
Welcome
Description of the problem
Hi.
It seems like that presence of some invalid code in thrid_party breaks the golangci-lint (see reproducer below).
Would it be possible to change the behavior of skip_dirs to not even look at those dirs?
Version of golangci-lint
Configuration
Fails even with empty config.
Go environment
Verbose output of running
A minimal reproducible example or link to a public repository
Validation
The text was updated successfully, but these errors were encountered: