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
|
tests: true
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
|
default: none
|
||||||
enable:
|
enable:
|
||||||
- errcheck
|
- errcheck
|
||||||
- govet
|
- govet
|
||||||
@@ -44,7 +45,7 @@ linters:
|
|||||||
- tparallel
|
- tparallel
|
||||||
- wastedassign
|
- wastedassign
|
||||||
|
|
||||||
linters-settings:
|
settings:
|
||||||
errcheck:
|
errcheck:
|
||||||
check-type-assertions: true
|
check-type-assertions: true
|
||||||
check-blank: true
|
check-blank: true
|
||||||
@@ -81,13 +82,18 @@ linters-settings:
|
|||||||
- "^FIXME:"
|
- "^FIXME:"
|
||||||
|
|
||||||
goimports:
|
goimports:
|
||||||
local-prefixes: github.com/0x524a/onvif-go
|
local-prefixes:
|
||||||
|
- github.com/0x524a/onvif-go
|
||||||
|
|
||||||
misspell:
|
misspell:
|
||||||
locale: US
|
locale: US
|
||||||
|
|
||||||
issues:
|
exclusions:
|
||||||
exclude-rules:
|
generated: lax
|
||||||
|
presets:
|
||||||
|
- comments
|
||||||
|
- std-error-handling
|
||||||
|
rules:
|
||||||
# Exclude some linters from test files
|
# Exclude some linters from test files
|
||||||
- path: _test\.go
|
- path: _test\.go
|
||||||
linters:
|
linters:
|
||||||
@@ -98,11 +104,6 @@ issues:
|
|||||||
- gocognit
|
- gocognit
|
||||||
- dupl
|
- 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
|
# Exclude dupl from ONVIF API files - similar patterns are expected
|
||||||
- path: (media|device|ptz|imaging|device_security|device_additional)\.go
|
- path: (media|device|ptz|imaging|device_security|device_additional)\.go
|
||||||
linters:
|
linters:
|
||||||
@@ -117,5 +118,6 @@ issues:
|
|||||||
max-same-issues: 10
|
max-same-issues: 10
|
||||||
|
|
||||||
output:
|
output:
|
||||||
print-issued-lines: true
|
formats:
|
||||||
|
text:
|
||||||
print-linter-name: true
|
print-linter-name: true
|
||||||
|
|||||||
Reference in New Issue
Block a user