windows_exporter/.golangci.yaml

89 lines
2.1 KiB
YAML
Raw Normal View History

2019-10-19 14:50:13 +00:00
linters:
enable-all: true
disable:
- cyclop
- depguard
- dupl
- err113
2024-09-10 22:34:10 +00:00
- execinquery
- exhaustive
- exhaustruct
- exportloopref
- fatcontext
- funlen
- gochecknoglobals
- gocognit
- goconst
- gocyclo
2024-09-10 22:34:10 +00:00
- gomnd
- lll
2024-09-10 22:34:10 +00:00
- maintidx
- mnd
- testpackage
- varnamelen
- wrapcheck
2024-09-10 22:34:10 +00:00
run:
timeout: 5m
2024-08-10 20:05:33 +00:00
linters-settings:
gosec:
excludes:
- G115 # integer overflow conversion
2024-08-10 20:05:33 +00:00
gci:
sections:
- prefix(github.com/prometheus-community/windows_exporter/pkg/initiate)
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
custom-order: true
tagliatelle:
case:
use-field-name: true
rules:
# Any struct tag type can be used.
# Support string case: `camel`, `pascal`, `kebab`, `snake`, `upperSnake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`, `header`
json: camel
yaml: snake
2024-09-10 22:34:10 +00:00
forbidigo:
forbid:
- "^(fmt\\.Print(|f|ln)|print|println)$"
- p: "^syscall\\..*$"
msg: use golang.org/x/sys/windows instead of syscall
- p: "^windows\\.NewLazyDLL$"
msg: use NewLazySystemDLL instead NewLazyDLL
sloglint:
no-mixed-args: true
kv-only: false
attr-only: true
no-global: "all"
context: "scope"
static-msg: false
no-raw-keys: false
key-naming-case: snake
forbidden-keys:
- time
- level
- msg
- source
args-on-sep-lines: true
stylecheck:
checks: ["all", "-ST1003"]
2019-10-19 14:50:13 +00:00
issues:
exclude:
- don't use underscores in Go names
- don't use an underscore in package name
2019-10-19 14:50:13 +00:00
- exported type .+ should have comment or be unexported
exclude-rules:
- # Golint has many capitalisation complaints on WMI class names
text: "`?\\w+`? should be `?\\w+`?"
linters:
- revive
- text: "don't use ALL_CAPS in Go names; use CamelCase"
linters:
- revive
2024-09-10 22:34:10 +00:00
- path: pkg/perflib/
linters:
- godox
- stylecheck