2019-04-24 12:18:40 +00:00
|
|
|
run:
|
2023-04-09 07:08:40 +00:00
|
|
|
timeout: 15m
|
2021-10-22 08:26:56 +00:00
|
|
|
skip-files:
|
|
|
|
# Skip autogenerated files.
|
|
|
|
- ^.*\.(pb|y)\.go$
|
2023-07-28 10:35:28 +00:00
|
|
|
skip-dirs:
|
|
|
|
# Copied it from a different source
|
|
|
|
- storage/remote/otlptranslator/prometheusremotewrite
|
2019-04-24 12:18:40 +00:00
|
|
|
|
2021-11-10 09:29:12 +00:00
|
|
|
output:
|
|
|
|
sort-results: true
|
|
|
|
|
2020-03-23 14:32:37 +00:00
|
|
|
linters:
|
|
|
|
enable:
|
2021-06-12 10:47:47 +00:00
|
|
|
- depguard
|
2023-09-27 21:34:18 +00:00
|
|
|
- errorlint
|
2023-04-09 07:08:40 +00:00
|
|
|
- gocritic
|
2023-10-03 20:09:25 +00:00
|
|
|
- godot
|
2021-10-22 08:27:37 +00:00
|
|
|
- gofumpt
|
|
|
|
- goimports
|
2022-03-03 17:11:19 +00:00
|
|
|
- misspell
|
2023-10-31 11:35:13 +00:00
|
|
|
- nolintlint
|
2023-05-21 07:20:07 +00:00
|
|
|
- predeclared
|
|
|
|
- revive
|
2023-04-09 07:08:40 +00:00
|
|
|
- unconvert
|
|
|
|
- unused
|
2020-03-23 14:32:37 +00:00
|
|
|
|
2019-05-03 13:11:28 +00:00
|
|
|
issues:
|
2022-04-27 09:24:36 +00:00
|
|
|
max-same-issues: 0
|
2019-05-03 13:11:28 +00:00
|
|
|
exclude-rules:
|
2023-04-09 07:08:40 +00:00
|
|
|
- linters:
|
|
|
|
- gocritic
|
|
|
|
text: "appendAssign"
|
2021-06-12 10:47:47 +00:00
|
|
|
- path: _test.go
|
|
|
|
linters:
|
|
|
|
- errcheck
|
2023-09-27 21:34:18 +00:00
|
|
|
- path: tsdb/
|
|
|
|
linters:
|
|
|
|
- errorlint
|
2023-11-02 20:45:07 +00:00
|
|
|
- path: tsdb/
|
|
|
|
text: "import 'github.com/pkg/errors' is not allowed"
|
2023-09-27 21:34:18 +00:00
|
|
|
linters:
|
2023-11-02 20:45:07 +00:00
|
|
|
- depguard
|
2023-10-03 20:09:25 +00:00
|
|
|
- linters:
|
|
|
|
- godot
|
|
|
|
source: "^// ==="
|
2019-05-03 13:11:28 +00:00
|
|
|
|
|
|
|
linters-settings:
|
2020-08-21 09:37:21 +00:00
|
|
|
depguard:
|
2023-06-27 11:51:29 +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"
|
|
|
|
- pkg: "io/ioutil"
|
|
|
|
desc: "Use corresponding 'os' or 'io' functions instead."
|
|
|
|
- pkg: "regexp"
|
|
|
|
desc: "Use github.com/grafana/regexp instead of regexp"
|
2023-11-02 20:45:07 +00:00
|
|
|
- pkg: "github.com/pkg/errors"
|
|
|
|
desc: "Use 'errors' or 'fmt' instead of github.com/pkg/errors"
|
2019-05-03 13:11:28 +00:00
|
|
|
errcheck:
|
2023-04-03 07:05:10 +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
|
2021-10-22 08:27:37 +00:00
|
|
|
goimports:
|
|
|
|
local-prefixes: github.com/prometheus/prometheus
|
|
|
|
gofumpt:
|
|
|
|
extra-rules: true
|
2023-04-04 08:28:19 +00:00
|
|
|
revive:
|
|
|
|
rules:
|
|
|
|
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
|
|
|
|
- name: unused-parameter
|
|
|
|
severity: warning
|
|
|
|
disabled: true
|