aa3465a726
- Upgraded golangci-lint version from v1.64.8 to v2.1.6 for enhanced linting capabilities. - Updated configuration to remove the lll linter and adjusted related settings for improved code quality checks. - Streamlined issue exclusions to better align with current project needs.
123 lines
2.0 KiB
YAML
123 lines
2.0 KiB
YAML
version: "2"
|
|
|
|
run:
|
|
timeout: 5m
|
|
tests: true
|
|
|
|
linters:
|
|
enable:
|
|
- errcheck
|
|
- govet
|
|
- staticcheck
|
|
- unused
|
|
- gosimple
|
|
- ineffassign
|
|
- typecheck
|
|
- gofmt
|
|
- goimports
|
|
- misspell
|
|
- unconvert
|
|
- unparam
|
|
- gocritic
|
|
- gosec
|
|
- copyloopvar
|
|
- goconst
|
|
- gocyclo
|
|
- dupl
|
|
- funlen
|
|
- gocognit
|
|
- nakedret
|
|
- prealloc
|
|
- stylecheck
|
|
- whitespace
|
|
- wrapcheck
|
|
- errname
|
|
- errorlint
|
|
- exhaustive
|
|
- godot
|
|
- err113
|
|
- mnd
|
|
- goprintffuncname
|
|
- nlreturn
|
|
- noctx
|
|
- nolintlint
|
|
- thelper
|
|
- tparallel
|
|
- wastedassign
|
|
|
|
linters-settings:
|
|
errcheck:
|
|
check-type-assertions: true
|
|
check-blank: true
|
|
|
|
gocyclo:
|
|
min-complexity: 15
|
|
|
|
funlen:
|
|
lines: 120
|
|
statements: 60
|
|
|
|
gocritic:
|
|
enabled-tags:
|
|
- diagnostic
|
|
- experimental
|
|
- opinionated
|
|
- performance
|
|
- style
|
|
disabled-checks:
|
|
- dupImport
|
|
- ifElseChain
|
|
- octalLiteral
|
|
- whyNoLint
|
|
- wrapperFunc
|
|
|
|
gosec:
|
|
severity: medium
|
|
confidence: medium
|
|
|
|
godot:
|
|
scope: declarations
|
|
exclude:
|
|
- "^TODO:"
|
|
- "^FIXME:"
|
|
|
|
goimports:
|
|
local-prefixes: github.com/0x524a/onvif-go
|
|
|
|
misspell:
|
|
locale: US
|
|
|
|
issues:
|
|
exclude-rules:
|
|
# Exclude some linters from test files
|
|
- path: _test\.go
|
|
linters:
|
|
- errcheck
|
|
- gosec
|
|
- funlen
|
|
- gocyclo
|
|
- gocognit
|
|
- dupl
|
|
|
|
# Exclude known false positives
|
|
- text: "Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|.*Write|.*Read|.*Printf?|.*Fprintf?) is not checked"
|
|
linters:
|
|
- errcheck
|
|
|
|
# Exclude dupl from ONVIF API files - similar patterns are expected
|
|
- path: (media|device|ptz|imaging|device_security|device_additional)\.go
|
|
linters:
|
|
- dupl
|
|
|
|
# Exclude dupl from cmd directories
|
|
- path: cmd/
|
|
linters:
|
|
- dupl
|
|
|
|
max-issues-per-linter: 50
|
|
max-same-issues: 10
|
|
|
|
output:
|
|
print-issued-lines: true
|
|
print-linter-name: true
|