Files
nats-server/.golangci.yml
Neil Twigg 8eeebe7ba6 Update golangci-lint to v1.59.1
Also fixes the configuration file to remove deprecated options and/or
to use new format.

Finally, run `goimports` on `jetstream_sourcing_scaling_test.go` to
satisfy the linter.

Signed-off-by: Neil Twigg <[email protected]>
2024-08-07 10:10:15 +01:00

72 lines
1.5 KiB
YAML

# Config file for golangci-lint
run:
concurrency: 4
issues-exit-code: 1
tests: true
modules-download-mode: readonly
output:
formats:
- format: colored-line-number
path: stdout
print-issued-lines: true
print-linter-name: true
linters:
disable-all: true
enable:
# - errcheck
- forbidigo
- goimports
- gosimple
- govet
- ineffassign
# - maligned
- misspell
# - prealloc
- staticcheck
# - unparam
- unused
linters-settings:
errcheck:
check-type-assertions: false
check-blank: false
forbidigo:
forbid:
- ^fmt\.Print(f|ln)?$
govet:
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
misspell:
locale: US
unparam:
check-exported: false
prealloc:
simple: true
range-loops: true
for-loops: true
issues:
exclude-dirs:
- .github
- doc
- docker
- logos
- scripts
- util
exclude-rules:
- path: "main.go" # Excludes main usage
linters: [forbidigo]
- source: "nats-server: v%s" # Excludes PrintServerAndExit
linters: [forbidigo]
- path: "server/opts.go" # Excludes TLS usage options
linters: [forbidigo]
- path: "_test.go" # Excludes unit tests
linters: [forbidigo]