linters-settings config not applying #3469
-
New to this project, which seems super useful, but running into an issue and I sort of suspect it's not a bug, but a new user issue. I've got a .golangci.yaml config in my project, and am running the linter using the docker command with version 1.50.1: docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.50.1 golangci-lint run -v The section that disables or enables linters works fine. But the linters:
# disable-all: true
# Uncomment to enable all linters
# enable-all: true
# disabling linters that are abandoned or replaced with better versions
disable:
- golint
- deadcode
- exhaustivestruct
- ifshort
- interfacer
- maligned
- nosnakecase
- scopelint
- structcheck
- varcheck
# additional non-default linters that we want to use
enable:
- gochecknoglobals
- gocritic
- goconst
- godox
- goerr113
- gofmt
- gosec
- misspell
- revive
- funlen
- ireturn
# - lll
- nonamedreturns
- varnamelen
# settings for specific linters - these don't appear to be applied
linters-settings:
revive:
enable-all-rules: false
severity: warning
rules:
- name: var-naming
disabled: true
- name: exported
disabled: true
- name: receiver-naming
disabled: true
varnamelen:
ignore-decls:
- i int |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello, YAML is based on indentation, the section https://golangci-lint.run/usage/configuration/ linters:
# disable-all: true
# Uncomment to enable all linters
# enable-all: true
# disabling linters that are abandoned or replaced with better versions
disable:
- golint
- deadcode
- exhaustivestruct
- ifshort
- interfacer
- maligned
- nosnakecase
- scopelint
- structcheck
- varcheck
# additional non-default linters that we want to use
enable:
- gochecknoglobals
- gocritic
- goconst
- godox
- goerr113
- gofmt
- gosec
- misspell
- revive
- funlen
- ireturn
# - lll
- nonamedreturns
- varnamelen
# settings for specific linters - these don't appear to be applied
linters-settings:
revive:
enable-all-rules: false
severity: warning
rules:
- name: var-naming
disabled: true
- name: exported
disabled: true
- name: receiver-naming
disabled: true
varnamelen:
ignore-decls:
- i int |
Beta Was this translation helpful? Give feedback.
Hello,
YAML is based on indentation, the section
linters-settings
must be at the first level.https://golangci-lint.run/usage/configuration/