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 .config #4554
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
Hello, the configuration of golangci-lint is not a simple tool configuration: it depends on the project and should be committed inside the project. If you run golangci-lint with the verbose flag, you will see that golangci-lint tries to find the configuration in several places: $ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /home/user/a/b/c /home/user/a/b /home/user/a /home/user /home /] I think that |
You confused XDG Regards, |
To have something that works, we will have to look at all the
|
🤔 maybe we can do that but the filename will stay 🤔 There is a problem with paths, inside the configuration, relative to the configuration position. |
Support for `.config` proposal from https://github.com/pi0/config-dir. While walking the tree, check if a directory named `.config` exist. If so, add it to `configSearchPaths` to include when searching for `.golangci.yaml`. Fixes golangci#4554
Since it's fairly easy and cheap to check for a |
My current thought is that we are not ready. It can feel easy to add the dir to the search (I also did it locally), but we currently have issues with paths inside the configuration as I said here. Some elements are relative to the configuration path, and some others to the execution path.
This is why I put the label |
I'm not sure I see the difference compared to when using I'm not saying that's a reason to add more problematic code and I understand your reasoning! |
I guess golangci should build the project root from config path by removing both filename and trailing |
One way of solving this would be to allow the config file to be go code, e.g. Having the config as code enables many powerful patterns that would otherwise not be possible in static formats like yaml. |
Your feature request related to a problem? Please describe.
golangci uses
.golangci.yml
file on top of project. This clutters root directory of projects.Describe the solution you'd like.
I suggest to search for
.config/golangci.yml
too as described at https://github.com/pi0/config-dirDescribe alternatives you've considered.
Using environment variable. This work on CI but is not easy for mates.
Additional context.
No response
The text was updated successfully, but these errors were encountered: