kvm/.golangci.yml

75 lines
1.6 KiB
YAML

version: '2'
linters:
enable:
- forbidigo
- misspell
- whitespace
- gochecknoinits
# Static analysis tool to detect potential nil panics in Go code.
- nilaway
# Checks function and package cyclomatic complexity.
- cyclop
# Check whether the function uses a non-inherited context.
- contextcheck
- gosec
- promlinter
settings:
forbidigo:
forbid:
- pattern: ^fmt\.Print.*$
msg: Do not commit print statements. Use logger package.
- pattern: ^log\.(Fatal|Panic|Print)(f|ln)?.*$
msg: Do not commit log statements. Use logger package.
custom:
nilaway:
type: module
description: 'Static analysis tool to detect potential nil panics in Go code.'
settings:
exclude-pkgs: vendor
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- errcheck
path: _test.go
- linters:
- forbidigo
path: cmd/main.go
- linters:
- gochecknoinits
path: internal/logging/sse.go
paths:
- third_party$
- builtin$
- examples$
severity:
default: error
rules:
- linters:
- cyclop
severity: warning
- linters:
- contextcheck
severity: warning
- linters:
- gosec
severity: warning
- linters:
- gosec
severity: warning
formatters:
enable:
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$