Files
onvif-go/.golangci.yml
T
0x524a 808498d1a0 chore: update linter configuration and enhance CI workflow
- Replaced 'exportloopref' with 'copyloopvar' in .golangci.yml for improved linting accuracy.
- Updated 'goerr113' to 'err113' for consistency in linter naming.
- Added Go setup step in the GitHub Actions workflow to specify Go version 1.23.
- Enhanced the gosec report upload process and added a step to display scan results in the CI workflow.
- Improved error handling in the unmarshalBody function to provide clearer error messages.
2025-12-02 01:06:28 -05:00

120 lines
1.9 KiB
YAML

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
- lll
- 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: 100
statements: 50
lll:
line-length: 120
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
# Exclude known false positives
- text: "Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|.*Write|.*Read|.*Printf?|.*Fprintf?) is not checked"
linters:
- errcheck
# Allow long lines in test files
- path: _test\.go
linters:
- lll
max-issues-per-linter: 50
max-same-issues: 10
exclude-use-default: false
output:
print-issued-lines: true
print-linter-name: true