-
-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: add golangci-lint config file #1312
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
Conversation
Is using |
It is recommended to use draft v4 or v7. Basically the lowest version that you need. Your schema seems to work fine with draft v4 |
OK I see, I'd still rather go with v7 to have |
I am quite confused by the CI error, as there is literally no |
Warning: Error: Unprocessed keywords: ["type"] at #/properties/linters-settings/properties/gocritic/properties/settings/propertyNames Use --force to continue. Point to this json block
and the propertyNames use a enum list of string? Is that posible? I never seen it before. I have never used propertyNames I only fix simple redundant "type" that can be removed. This is something else. |
Exactly, this means that the keys are allowed to be one of the string enum. There is no |
I type |
@zepatrik |
I could list all of the properties there, but a) there are 68 of them, b) they are not further typed and c) the same 68 constants are used as array values in two other places. I really want to reduce the overhead there. Adding one item more should only happen in one place. |
I do not see "properties": {} in your code. maybe that is the issue. |
your example would validate the following yaml: settings:
propertyNames: "one of the enum values" but I want to validate settings:
"one of the enum values": anything |
Ok so I switched back to draft 2019-09 which actually fixed the problems schemasafe had. You can read more about that here: ExodusMovement/schemasafe#139 |
Let me know when it's ready to merge |
As it seems that nobody from golanci-lint is interested in reviewing this PR, I would say it is ready to merge. The other issue with schemasafe is probably also going to take a bit longer. |
Thanks |
This adds the golangci-lint config file schema derived from https://golangci-lint.run/usage/configuration/#config-file
As I am not affiliated with golangci-lint in any way, we can maybe wait for someone from their community to validate this schema. Hence I am opening this as a draft PR for now.