-
-
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
Add pre-commit
hook to run config verify
#4602
Add pre-commit
hook to run config verify
#4602
Conversation
Hey, thank you for opening your first Pull Request ! |
Add this as a way to easily ensure configs stay valid. Filenames are not passed to the hook, this means For the default case (config in one of the default searched files), the config is picked up automatically and there's nothing extra to configure. For the case of a non-standard config setup the hook can be configured like repos: - repo: https://github.com/golangci/golangci-lint rev: v1.57.2 hooks: - id: golangci-lint-config-verify # config is kept at '.golangci-config.yaml' files: \.golangci-config\.yaml args: ['--config', '.golangci-config.yaml']
0c67d00
to
f13fbbd
Compare
I skipped submitting a feature request issue since it seemed as simple to just discuss the change itself |
The validation of the configuration against the JSON Schema is different than using Also, I don't see the point in systematically checking a configuration which most of the time has not changed. I'm not a pre-commit user, by choice, maybe there is an interest in this validation hook that I don't see, and I will be happy to learn about it. |
This hook will only be executed via
My use case is: I just want to keep my config up-to-date: if a change brings deprecates some option I'm using then I want to be aware of if (and remove it) as soon as I can. This could probably also be solved by just running I have no opinion re: potential misunderstandings, if you think this has the potential to be a bother then I have no objections
This would require everyone working in a project to have their (potentially various) IDEs/editors configured to handle this, vs. just having everyone install |
It's not a blocker, it's more a warning, if there are too many issues on the topic, we will see how to handle that.
At least for the IDEs I use, there is no configuration required, no specific user action or installation, it's just handled automatically based on the file name. The configuration file names are defined inside the schema store: https://github.com/SchemaStore/schemastore/blob/c42ad08e78f70a0d37f6fb53a204371ef80bc3d4/src/api/json/catalog.json#L2139-L2143 But I'm not a pre-commit user, and your workflow seems right for a pre-commit user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
👍 I'd be happy to be pinged/included if any such issues do arise |
Add this as a way to easily ensure configs stay valid. Filenames are not passed to the hook, this means For the default case (config in one of the default searched files), the config is picked up automatically and there's nothing extra to configure. For the case of a non-standard config setup the hook can be configured like