-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
golangci-lint fails if it can't read the contents of a directory, even if it's in --skip-dirs #1832
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
@zealws As far as I know: Skip Dirs is a post-processor i.e., golangci-lint being a meta linter cannot control every aspect of the linter that it is running. The loader that it uses is also not aware of skip dirs, files, etc. and it shouldn't be either because it makes it super complex then. So, the loader (for AST parsing, dependency resolution, etc.) is working just fine and the output that you are seeing is from there only, I guess. Also, as Skip Dirs is a post-processor, golangci-lint will collect issues raised by every linter that it is running and then runs a set of post-processor(s) — like SkipDirs which then excludes the issues for files that are present in those directories. So, I do not think it's a bug at all. If you see an issue raised by golangci-lint for files present inside inside |
@shmsr So how to make it not look in a directory? Currently if we run it on the root of our project it fails because of some issue inside a go file in We don't want to lint that file. How can we tell it to not look inside node_modules? |
I also observe I can only imagine how many CPU cycles are being wasted by traversing Edit: golang/go#42965 would probably one way to solve it. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Close in favor of #4360 - Feel free to subscribe there for updates. |
Description of the problem
If there is a directory that is not readable in the current project, golangci-lint fails.
This is expected, as it can't lint potential files inside a directory that is not readable.
However, adding the directory to
skip-dirs
either on the command line, or via the yaml config does not allow golangci-lint to function against the other directories which it can read from.Version of golangci-lint
Config file
Go environment
Verbose output of running
In that error
solrdata/data
is owned by root and not readable as the current user.Code example or link to a public repository
I was not able to come up with a simple test case of this because of a different golangci-lint issue, but you should be able to reproduce this in the following way with any repository:
golangci-lint run ...
with--skip-dirs
The text was updated successfully, but these errors were encountered: