2023-09-04 17:03:44 +02:00
|
|
|
run:
|
|
|
|
# Timeout for analysis, e.g. 30s, 5m.
|
|
|
|
# Default: 1m
|
|
|
|
timeout: 6m
|
|
|
|
|
|
|
|
# This file contains only configs which differ from defaults.
|
|
|
|
# All possible options can be found here https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
|
|
|
|
linters-settings:
|
|
|
|
errcheck:
|
|
|
|
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
|
|
|
|
# Such cases aren't reported by default.
|
|
|
|
# Default: false
|
|
|
|
check-type-assertions: false
|
|
|
|
|
|
|
|
govet:
|
|
|
|
# Enable all analyzers.
|
|
|
|
# Default: false
|
|
|
|
enable-all: false
|
|
|
|
enable:
|
|
|
|
- nilness
|
|
|
|
|
|
|
|
linters:
|
|
|
|
disable-all: true
|
|
|
|
enable:
|
|
|
|
## enabled by default
|
|
|
|
- errcheck # checking for unchecked errors, these unchecked errors can be critical bugs in some cases
|
|
|
|
- gosimple # specializes in simplifying a code
|
|
|
|
- govet # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
|
|
|
|
- ineffassign # detects when assignments to existing variables are not used
|
|
|
|
- staticcheck # is a go vet on steroids, applying a ton of static analysis checks
|
|
|
|
- typecheck # like the front-end of a Go compiler, parses and type-checks Go code
|
|
|
|
- unused # checks for unused constants, variables, functions and types
|
|
|
|
## disable by default but the have interesting results so lets add them
|
|
|
|
- bodyclose # checks whether HTTP response body is closed successfully
|
2023-11-10 16:33:13 +01:00
|
|
|
- dupword # dupword checks for duplicate words in the source code
|
|
|
|
- durationcheck # durationcheck checks for two durations multiplied together
|
|
|
|
- forbidigo # forbidigo forbids identifiers
|
|
|
|
- mirror # mirror reports wrong mirror patterns of bytes/strings usage
|
|
|
|
- misspell # misspess finds commonly misspelled English words in comments
|
2023-09-04 17:03:44 +02:00
|
|
|
- nilerr # finds the code that returns nil even if it checks that the error is not nil
|
|
|
|
- nilnil # checks that there is no simultaneous return of nil error and an invalid value
|
2023-11-10 16:33:13 +01:00
|
|
|
- predeclared # predeclared finds code that shadows one of Go's predeclared identifiers
|
2023-09-04 17:03:44 +02:00
|
|
|
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed
|
2023-11-10 16:33:13 +01:00
|
|
|
- thelper # thelper detects Go test helpers without t.Helper() call and checks the consistency of test helpers.
|
2023-09-04 17:03:44 +02:00
|
|
|
- wastedassign # wastedassign finds wasted assignment statements
|
|
|
|
issues:
|
|
|
|
# Maximum count of issues with the same text.
|
|
|
|
# Set to 0 to disable.
|
|
|
|
# Default: 3
|
|
|
|
max-same-issues: 5
|
|
|
|
|
|
|
|
exclude-rules:
|
2023-11-10 16:33:13 +01:00
|
|
|
# allow fmt
|
|
|
|
- path: management/cmd/root.go
|
|
|
|
linters: forbidigo
|
|
|
|
- path: signal/cmd/root.go
|
|
|
|
linters: forbidigo
|
2023-09-04 17:03:44 +02:00
|
|
|
- path: sharedsock/filter.go
|
|
|
|
linters:
|
|
|
|
- unused
|
|
|
|
- path: client/firewall/iptables/rule.go
|
|
|
|
linters:
|
|
|
|
- unused
|
2023-11-10 16:33:13 +01:00
|
|
|
- path: test.go
|
|
|
|
linters:
|
|
|
|
- mirror
|
2023-09-04 17:03:44 +02:00
|
|
|
- path: mock.go
|
|
|
|
linters:
|
2023-11-10 16:33:13 +01:00
|
|
|
- nilnil
|