Repository navigation
|
I found a schema inconsistency through my IDE’s YAML autocompletion, which uses the published golangci-lint schema. Formatter names are not offered in Minimal example version: "2"
formatters:
enable:
- gofmt
- gci
- goimports
linters:
exclusions:
rules:
# Do not report formatting findings for generated code.
- path: '(^|/)generated/'
linters:
- gofmt
- gci
- goimports
severity:
# Default severity for all findings.
default: info
rules:
# Formatting findings are less important than other findings.
- linters:
- gofmt
- gci
- goimports
severity: minorgolangci-lint version: 2.15.0 I feel like the root causes is about using |
Replies: 2 comments 4 replies
|
Yes. Also, in v2 the path is |
|
Formatters are not linters, using formatter's names inside
This constraint is based on the know names of the linters or a string: golangci-lint/jsonschema/golangci.jsonschema.json Lines 840 to 963 in b6379d1 The string is for custom linter names not formatter names. So this is not an inconsistency but the expected behavior. |
I know, but you should not do that: this is not an expected behavior ("bug"), you should not relies on it.
Don't try to hack around formatters inside linter configuration: remember that, for me, this is not a supported behavior or something I want to support.
So this behavior can change at any moment without any warning.