Files
coredns/.golangci.yml
Syed Azeez 7b38eb8625 plugin: fix gosec G115 integer overflow warnings (#7799)
Fix integer overflow conversion warnings (G115) by adding appropriate
suppressions where values are provably bounded.

Fixes: https://github.com/coredns/coredns/issues/7793

Changes:
- Updated 56 G115 annotations to use consistent // #nosec G115 format
- Added 2 //nolint:gosec suppressions for conditional expressions
- Removed G115 exclusion from golangci.yml (now explicitly handled per-line)

Suppressions justify why each conversion is safe (e.g., port numbers
are bounded 1-65535, DNS TTL limits, pool lengths, etc.)

Signed-off-by: Azeez Syed <syedazeez337@gmail.com>
2026-01-01 10:20:29 +02:00

124 lines
2.1 KiB
YAML

version: "2"
issues:
max-issues-per-linter: 0
max-same-issues: 0
linters:
default: none
enable:
- canonicalheader
- copyloopvar
- durationcheck
- godoclint
- gosec
- govet
- ineffassign
- intrange
- modernize
- nakedret
- nolintlint
- perfsprint
- prealloc
- protogetter
- staticcheck
- thelper
- unconvert
- unused
- usetesting
- wastedassign
- whitespace
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- perfsprint
- gosec
settings:
govet:
enable:
- nilness
perfsprint:
error-format: false
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