-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Verify the .golangci.yaml config #2645
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. |
Maybe related to this issue #1453 I was trying to do this by a separate command, but found problems. the idea was to use https://github.com/santhosh-tekuri/jsonschema with https://json.schemastore.org/golangci-lint.json (per #4247 (reply in thread)) Example of command
But https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/golangci-lint.json is not up to date with https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml (missing fields, like Also, if |
The branch https://github.com/SchemaStore/schemastore/pulls?q=is%3Apr+author%3Aldez+is%3Aclosed |
Checked the file in the release tag https://github.com/golangci/golangci-lint/blob/e3c2265f4939976874989e159386b3bb7dcf8e1f/.golangci.reference.yml and it really has |
It's just a mistake. The contribution guide to SchemaStore repo is here: https://github.com/SchemaStore/schemastore/blob/master/CONTRIBUTING.md |
This comment was marked as off-topic.
This comment was marked as off-topic.
just an update, https://json.schemastore.org/golangci-lint.json is now up to date with last release. So, the idea of using https://github.com/santhosh-tekuri/jsonschema with https://json.schemastore.org/golangci-lint.json for checking latest release config file is valid. Example
If this schema could be shipped with each release, we could add similar solution for each release, and not only latest. A idea for next release is to run this command against https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml prior to release. If can catch missing fields in the schema |
Is the issue to be able to verify the |
The issue is about a CLI command to verify the configuration, even if I thing it's better to use JSON schema inside an IDE or text editor, we can do something. |
Your feature request related to a problem? Please describe.
Crafting the .golangci.yaml can be a little challenging as the config grows or just getting right the first time. For example, I was crafting a config and had my indention off for the
linters-settings:
and rather than error'ing, the linter-settings were just not applied.Describe the solution you'd like.
I propose a
verify
command is added to thegolangci-lint
CLI tool that will verify the config schema.Describe alternatives you've considered.
Alternatively,
golangci-lint run
could throw an error when the config does not conform to the top-level schema.Additional context.
No response
The text was updated successfully, but these errors were encountered: