-
-
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
Support local .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. |
Was redirected here after my PR got closed. I actually did a search of the issues and PRs before this and found nothing. Perhaps it'll be helpful to have
While I see the issue that may be created with this,
Right now if I want golangci-lint to simultaneously search for repo config and fallback to a global config if the repo config is not found, I'll have to put it in If the path issue comes solely from having to find the project's root when in a subdirectory of the project, perhaps search upwards for Thanks for making this project. I hope my two cents could be of some help. |
This issue is not related to XDG. .config is an universal local config directory for developer tools. @k4yt3x your use case seems valid and may be implemented with local .config directory anyway. |
@bersace so I guess I'm being redirected here not because this is the same issue but only because the comments here are related to what I'm trying to do? What I'm trying to achieve is not to have a local .config (if I understand your case correctly), but to have one, singular, config in I'm a bit confused as to what should be done at this point to be honest. |
Just to be clear, I didn't say that the PR was a "duplicate" or was about the exact same topic as this issue. |
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: