chore: update golangci-lint configuration for improved clarity and functionality
- Set default linters to none and reorganized settings for better structure. - Enhanced exclusion rules for specific linters in test files and ONVIF API files to reduce false positives. - Updated output formatting options for clearer linting results.
This commit is contained in:
+12
-10
@@ -5,6 +5,7 @@ run:
|
||||
tests: true
|
||||
|
||||
linters:
|
||||
default: none
|
||||
enable:
|
||||
- errcheck
|
||||
- govet
|
||||
@@ -44,7 +45,7 @@ linters:
|
||||
- tparallel
|
||||
- wastedassign
|
||||
|
||||
linters-settings:
|
||||
settings:
|
||||
errcheck:
|
||||
check-type-assertions: true
|
||||
check-blank: true
|
||||
@@ -81,13 +82,18 @@ linters-settings:
|
||||
- "^FIXME:"
|
||||
|
||||
goimports:
|
||||
local-prefixes: github.com/0x524a/onvif-go
|
||||
local-prefixes:
|
||||
- github.com/0x524a/onvif-go
|
||||
|
||||
misspell:
|
||||
locale: US
|
||||
|
||||
issues:
|
||||
exclude-rules:
|
||||
exclusions:
|
||||
generated: lax
|
||||
presets:
|
||||
- comments
|
||||
- std-error-handling
|
||||
rules:
|
||||
# Exclude some linters from test files
|
||||
- path: _test\.go
|
||||
linters:
|
||||
@@ -98,11 +104,6 @@ issues:
|
||||
- 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:
|
||||
@@ -117,5 +118,6 @@ issues:
|
||||
max-same-issues: 10
|
||||
|
||||
output:
|
||||
print-issued-lines: true
|
||||
formats:
|
||||
text:
|
||||
print-linter-name: true
|
||||
|
||||
Reference in New Issue
Block a user