2021-01-30 15:03:07 +00:00
|
|
|
# This is the configuration for golangci-lint for the restic project.
|
|
|
|
#
|
|
|
|
# A sample config with all settings is here:
|
|
|
|
# https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
|
|
|
|
|
|
|
|
linters:
|
|
|
|
# only enable the linters listed below
|
|
|
|
disable-all: true
|
|
|
|
enable:
|
|
|
|
# make sure all errors returned by functions are handled
|
|
|
|
- errcheck
|
|
|
|
|
|
|
|
# show how code can be simplified
|
|
|
|
- gosimple
|
|
|
|
|
2023-05-18 16:02:38 +00:00
|
|
|
# make sure code is formatted
|
2021-01-30 15:03:07 +00:00
|
|
|
- gofmt
|
|
|
|
|
|
|
|
# examine code and report suspicious constructs, such as Printf calls whose
|
|
|
|
# arguments do not align with the format string
|
|
|
|
- govet
|
|
|
|
|
|
|
|
# make sure names and comments are used according to the conventions
|
2022-03-28 20:33:17 +00:00
|
|
|
- revive
|
2021-01-30 15:03:07 +00:00
|
|
|
|
|
|
|
# detect when assignments to existing variables are not used
|
|
|
|
- ineffassign
|
|
|
|
|
|
|
|
# run static analysis and find errors
|
|
|
|
- staticcheck
|
|
|
|
|
|
|
|
# find unused variables, functions, structs, types, etc.
|
|
|
|
- unused
|
|
|
|
|
|
|
|
# parse and typecheck code
|
|
|
|
- typecheck
|
|
|
|
|
2024-01-06 14:38:57 +00:00
|
|
|
# ensure that http response bodies are closed
|
|
|
|
- bodyclose
|
|
|
|
|
2021-01-30 15:03:07 +00:00
|
|
|
issues:
|
|
|
|
# don't use the default exclude rules, this hides (among others) ignored
|
|
|
|
# errors from Close() calls
|
|
|
|
exclude-use-default: false
|
|
|
|
|
|
|
|
# list of things to not warn about
|
|
|
|
exclude:
|
2022-03-28 20:33:17 +00:00
|
|
|
# revive: do not warn about missing comments for exported stuff
|
|
|
|
- exported (function|method|var|type|const) .* should have comment or be unexported
|
|
|
|
# revive: ignore constants in all caps
|
2021-01-30 15:03:07 +00:00
|
|
|
- don't use ALL_CAPS in Go names; use CamelCase
|
2022-09-27 19:31:32 +00:00
|
|
|
# revive: lots of packages don't have such a comment
|
|
|
|
- "package-comments: should have a package comment"
|
2023-05-18 16:14:42 +00:00
|
|
|
# staticcheck: there's no easy way to replace these packages
|
|
|
|
- "SA1019: \"golang.org/x/crypto/poly1305\" is deprecated"
|
|
|
|
- "SA1019: \"golang.org/x/crypto/openpgp\" is deprecated"
|