2019-04-25 08:44:57 +00:00
|
|
|
run:
|
2022-03-25 16:59:51 +00:00
|
|
|
skip-files:
|
|
|
|
# Skip autogenerated files.
|
|
|
|
- ^.*\.(pb|y)\.go$
|
2023-11-24 21:17:35 +00:00
|
|
|
timeout: 5m
|
2022-03-25 16:59:51 +00:00
|
|
|
|
|
|
|
output:
|
|
|
|
sort-results: true
|
|
|
|
|
|
|
|
linters:
|
|
|
|
enable:
|
|
|
|
- depguard
|
2023-11-24 21:17:35 +00:00
|
|
|
- errorlint
|
2022-03-25 16:59:51 +00:00
|
|
|
- gofumpt
|
|
|
|
- goimports
|
|
|
|
- misspell
|
2023-12-10 08:33:13 +00:00
|
|
|
- revive
|
|
|
|
- testifylint
|
2022-03-25 16:59:51 +00:00
|
|
|
|
2019-04-29 08:54:40 +00:00
|
|
|
issues:
|
2023-11-24 21:17:35 +00:00
|
|
|
max-issues-per-linter: 0
|
|
|
|
max-same-issues: 0
|
2019-04-29 08:54:40 +00:00
|
|
|
exclude-rules:
|
2021-12-22 13:03:53 +00:00
|
|
|
- path: _test.go
|
|
|
|
linters:
|
|
|
|
- errcheck
|
2022-03-25 16:59:51 +00:00
|
|
|
|
2019-04-29 08:54:40 +00:00
|
|
|
linters-settings:
|
2022-03-25 16:59:51 +00:00
|
|
|
depguard:
|
2023-12-07 16:42:42 +00:00
|
|
|
rules:
|
|
|
|
main:
|
|
|
|
deny:
|
|
|
|
- pkg: sync/atomic
|
|
|
|
desc: "Use go.uber.org/atomic instead of sync/atomic"
|
|
|
|
- pkg: github.com/stretchr/testify/assert
|
|
|
|
desc: "Use github.com/stretchr/testify/require instead of github.com/stretchr/testify/assert"
|
|
|
|
- pkg: github.com/go-kit/kit/log
|
|
|
|
desc: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
|
2023-11-24 21:17:35 +00:00
|
|
|
- pkg: github.com/pkg/errors
|
|
|
|
desc: "Use errors or fmt instead of github.com/pkg/errors"
|
2019-04-29 08:54:40 +00:00
|
|
|
errcheck:
|
2023-09-04 08:40:11 +00:00
|
|
|
exclude-functions:
|
|
|
|
# Don't flag lines such as "io.Copy(io.Discard, resp.Body)".
|
|
|
|
- io.Copy
|
|
|
|
# The next two are used in HTTP handlers, any error is handled by the server itself.
|
|
|
|
- io.WriteString
|
|
|
|
- (net/http.ResponseWriter).Write
|
|
|
|
# No need to check for errors on server's shutdown.
|
|
|
|
- (*net/http.Server).Shutdown
|
|
|
|
# Never check for logger errors.
|
|
|
|
- (github.com/go-kit/log.Logger).Log
|
|
|
|
# Never check for rollback errors as Rollback() is called when a previous error was detected.
|
|
|
|
- (github.com/prometheus/prometheus/storage.Appender).Rollback
|
2022-03-25 16:59:51 +00:00
|
|
|
goimports:
|
|
|
|
local-prefixes: github.com/prometheus/alertmanager
|
|
|
|
gofumpt:
|
|
|
|
extra-rules: true
|
|
|
|
revive:
|
|
|
|
rules:
|
|
|
|
- name: exported
|
|
|
|
arguments: ["disableStutteringCheck"]
|
|
|
|
- name: blank-imports
|
|
|
|
- name: context-as-argument
|
|
|
|
- name: error-return
|
|
|
|
- name: error-strings
|
|
|
|
- name: error-naming
|
|
|
|
- name: if-return
|
|
|
|
- name: increment-decrement
|
|
|
|
- name: var-naming
|
|
|
|
- name: var-declaration
|
|
|
|
- name: package-comments
|
|
|
|
- name: range
|
|
|
|
- name: receiver-naming
|
|
|
|
- name: time-naming
|
|
|
|
- name: unexported-return
|
|
|
|
- name: indent-error-flow
|
|
|
|
- name: errorf
|
2023-12-10 08:33:13 +00:00
|
|
|
testifylint:
|
|
|
|
disable:
|
|
|
|
- float-compare
|
|
|
|
- go-require
|
|
|
|
enable:
|
|
|
|
- bool-compare
|
|
|
|
- compares
|
|
|
|
- empty
|
|
|
|
- error-is-as
|
|
|
|
- error-nil
|
|
|
|
- expected-actual
|
|
|
|
- len
|
|
|
|
- require-error
|
|
|
|
- suite-dont-use-pkg
|
|
|
|
- suite-extra-assert-call
|