Files
coredns/.golangci.yml
Ville Vesilehto c916cf4259 fix(plugin): nilness findings (#7556)
Enable nilness linter in govet.

Plugin-by-plugin rationale:

- plugin/transfer: reuse error instead of shadowing it inside the for
  loop by declaring "ret" outside of the loop
- plugin/view: remove redundant err check
- plugin/dnstap: avoid possible nil dereference in error reporting
  path in setup test
- plugin/forward: prevent nil deference or empty-slice dereference on
  error paths in setup test

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
2025-09-15 10:17:06 -07:00

111 lines
1.9 KiB
YAML

version: "2"
issues:
max-issues-per-linter: 0
max-same-issues: 0
linters:
default: none
enable:
- canonicalheader
- copyloopvar
- durationcheck
- govet
- ineffassign
- intrange
- nolintlint
- prealloc
- protogetter
- staticcheck
- thelper
- unconvert
- unused
- usetesting
- wastedassign
- whitespace
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
settings:
govet:
enable:
- nilness
revive:
rules:
- name: blank-imports
- name: context-as-argument
arguments:
- allowTypesBefore: "*testing.T"
- name: context-keys-type
- name: dot-imports
- name: early-return
arguments:
- "preserveScope"
- name: empty-block
disabled: true
- name: error-naming
- name: error-return
- name: error-strings
- name: errorf
- name: increment-decrement
- name: indent-error-flow
arguments:
- "preserveScope"
- name: range
- name: receiver-naming
- name: redefines-builtin-id
disabled: true
- name: superfluous-else
arguments:
- "preserveScope"
- name: time-naming
disabled: true
- name: unexported-return
disabled: true
- name: unnecessary-stmt
- name: unreachable-code
- name: unused-parameter
arguments:
- allowRegex: "^_"
- name: use-any
- name: var-declaration
- name: var-naming
disabled: true
arguments:
- ["ID"]
- ["VM"]
- - upperCaseConst: true
formatters:
enable:
- gofmt
exclusions:
generated: lax