00e2e0d46f
- Enhanced .golangci.yml with additional linters and settings for improved code quality checks. - Updated CI workflow to include multiple branches for pull requests and improved caching strategies. - Added new workflows for documentation checks, dependency reviews, and security scans. - Refined coverage analysis workflow to provide detailed reports and comments on pull requests. - Removed outdated test workflow and consolidated testing strategies into extended tests. - Improved release workflow with better version handling and artifact management.
135 lines
2.2 KiB
YAML
135 lines
2.2 KiB
YAML
run:
|
|
timeout: 5m
|
|
tests: true
|
|
skip-dirs:
|
|
- vendor
|
|
- testdata
|
|
skip-files:
|
|
- ".*\\.pb\\.go$"
|
|
- ".*\\.gen\\.go$"
|
|
|
|
linters:
|
|
enable:
|
|
- errcheck
|
|
- govet
|
|
- staticcheck
|
|
- unused
|
|
- gosimple
|
|
- ineffassign
|
|
- typecheck
|
|
- gofmt
|
|
- goimports
|
|
- misspell
|
|
- unconvert
|
|
- unparam
|
|
- gocritic
|
|
- gosec
|
|
- exportloopref
|
|
- goconst
|
|
- gocyclo
|
|
- dupl
|
|
- funlen
|
|
- gocognit
|
|
- lll
|
|
- nakedret
|
|
- prealloc
|
|
- stylecheck
|
|
- whitespace
|
|
- wrapcheck
|
|
- errname
|
|
- errorlint
|
|
- exhaustive
|
|
- godot
|
|
- goerr113
|
|
- gomnd
|
|
- goprintffuncname
|
|
- nlreturn
|
|
- noctx
|
|
- nolintlint
|
|
- rowserrcheck
|
|
- sqlclosecheck
|
|
- thelper
|
|
- tparallel
|
|
- wastedassign
|
|
|
|
linters-settings:
|
|
errcheck:
|
|
check-type-assertions: true
|
|
check-blank: true
|
|
|
|
govet:
|
|
check-shadowing: true
|
|
enable-all: 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:
|
|
formats:
|
|
- colored-line-number
|
|
print-issued-lines: true
|
|
print-linter-name: true
|
|
uniq-by-line: false
|