mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-28 15:29:09 +01:00
152 lines
3.6 KiB
YAML
152 lines
3.6 KiB
YAML
version: "2"
|
|
linters:
|
|
default: none
|
|
enable:
|
|
- bodyclose
|
|
- dupword
|
|
- durationcheck
|
|
- errcheck
|
|
- forbidigo
|
|
- gocritic
|
|
- gosec
|
|
- govet
|
|
- ineffassign
|
|
- mirror
|
|
- misspell
|
|
- nilerr
|
|
- nilnil
|
|
- predeclared
|
|
- revive
|
|
- sqlclosecheck
|
|
- staticcheck
|
|
- unused
|
|
- wastedassign
|
|
settings:
|
|
errcheck:
|
|
check-type-assertions: false
|
|
forbidigo:
|
|
analyze-types: true
|
|
forbid:
|
|
- pattern: ^(fmt\.Print(|f|ln)|print|println)$
|
|
# Builds that link libc through purego mark the runtime as cgo without
|
|
# registering the libc setxid hooks, so these panic in AllThreadsSyscall.
|
|
- pattern: ^(syscall|unix)\.(Setgroups|Set(e|re|res)?[ug]id|AllThreadsSyscall6?)$
|
|
pkg: ^(syscall|golang\.org/x/sys/unix)$
|
|
msg: use the setgroups/setgid/setuid helpers in client/ssh/server, which go through libc in purego builds
|
|
gocritic:
|
|
disabled-checks:
|
|
- commentFormatting
|
|
- captLocal
|
|
- deprecatedComment
|
|
gosec:
|
|
includes:
|
|
- G101
|
|
- G103
|
|
- G104
|
|
- G106
|
|
- G108
|
|
- G109
|
|
- G110
|
|
- G111
|
|
- G201
|
|
- G202
|
|
- G203
|
|
- G301
|
|
- G302
|
|
- G303
|
|
- G304
|
|
- G305
|
|
- G306
|
|
- G307
|
|
- G403
|
|
- G502
|
|
- G503
|
|
- G504
|
|
- G601
|
|
- G602
|
|
govet:
|
|
enable:
|
|
- nilness
|
|
disable:
|
|
# The inline analyzer flags x/exp/maps Clone/Clear with //go:fix inline
|
|
# directives but cannot perform the rewrite due to generic type
|
|
# parameter inference limitations in the Go inliner.
|
|
- inline
|
|
enable-all: false
|
|
revive:
|
|
rules:
|
|
- name: exported
|
|
arguments:
|
|
- checkPrivateReceivers
|
|
- sayRepetitiveInsteadOfStutters
|
|
severity: warning
|
|
disabled: false
|
|
exclusions:
|
|
generated: lax
|
|
presets:
|
|
- comments
|
|
- common-false-positives
|
|
- legacy
|
|
- std-error-handling
|
|
rules:
|
|
- linters:
|
|
- forbidigo
|
|
path: management/cmd/root\.go
|
|
- linters:
|
|
- forbidigo
|
|
path: signal/cmd/root\.go
|
|
- linters:
|
|
- forbidigo
|
|
path: client/ssh/server/setid_unix\.go
|
|
- linters:
|
|
- unused
|
|
path: sharedsock/filter\.go
|
|
- linters:
|
|
- unused
|
|
path: client/firewall/iptables/rule\.go
|
|
- linters:
|
|
- gosec
|
|
- mirror
|
|
path: test\.go
|
|
- linters:
|
|
- nilnil
|
|
path: mock\.go
|
|
- linters:
|
|
- staticcheck
|
|
text: grpc.DialContext is deprecated
|
|
- linters:
|
|
- staticcheck
|
|
text: grpc.WithBlock is deprecated
|
|
- linters:
|
|
- staticcheck
|
|
text: "QF1001"
|
|
- linters:
|
|
- staticcheck
|
|
text: "QF1008"
|
|
- linters:
|
|
- staticcheck
|
|
text: "QF1012"
|
|
# client/ui/main.go uses //go:embed all:frontend/dist; the
|
|
# directory is populated by `pnpm build` in the release pipeline
|
|
# and missing at lint time, so the embed parses to "no matching
|
|
# files found" — surfaced by golangci-lint's typecheck pre-pass.
|
|
# Suppress just that one diagnostic; the rest of the package
|
|
# (services/, tray.go, grpc.go, ...) still gets linted normally.
|
|
- linters:
|
|
- typecheck
|
|
path: client/ui/main\.go
|
|
text: "pattern all:frontend/dist"
|
|
paths:
|
|
- third_party$
|
|
- builtin$
|
|
- examples$
|
|
issues:
|
|
max-same-issues: 5
|
|
formatters:
|
|
exclusions:
|
|
generated: lax
|
|
paths:
|
|
- third_party$
|
|
- builtin$
|
|
- examples$
|