rest-server/.golangci.yml

45 lines
1.2 KiB
YAML
Raw Normal View History

2025-12-06 20:16:26 +01:00
version: "2"
2021-01-31 13:07:18 +01:00
linters:
# only enable the linters listed below
2025-12-06 20:16:26 +01:00
default: none
2021-01-31 13:07:18 +01:00
enable:
2025-12-06 20:16:26 +01:00
# ensure that http response bodies are closed
- bodyclose
2021-01-31 13:07:18 +01:00
# make sure all errors returned by functions are handled
- errcheck
# examine code and report suspicious constructs, such as Printf calls whose
# arguments do not align with the format string
- govet
2025-12-06 20:16:26 +01:00
# consistent imports
- importas
2021-01-31 13:07:18 +01:00
# detect when assignments to existing variables are not used
- ineffassign
2025-12-06 20:16:26 +01:00
# make sure names and comments are used according to the conventions
- revive
2021-01-31 13:07:18 +01:00
# run static analysis and find errors
- staticcheck
# find unused variables, functions, structs, types, etc.
- unused
2025-12-06 20:16:26 +01:00
exclusions:
rules:
- path: (.+)\.go$
text: exported (function|method|var|type|const) .* should have comment or be unexported
- path: (.+)\.go$
text: don't use ALL_CAPS in Go names; use CamelCase
- path: (.+)\.go$
text: "package-comments: should have a package comment"
- path: (.+)\.go$
text: "redefines-builtin-id:"
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
exclusions:
paths:
- third_party$
- builtin$
- examples$