mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 05:34:05 -08:00
golangci: Use depguard to prevent using restricted packages (#7825)
Enabling this linter in golangci will check that we are not using restricted packages, and when a match is found, it will provide a message suggesting the alternative package. In this particular case, we enable it for `sync/atomic`. Signed-off-by: Javier Palomo <javier.palomo.almena@gmail.com>
This commit is contained in:
parent
624075eafe
commit
7ec647dbe9
|
@ -4,6 +4,7 @@ run:
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
|
- depguard
|
||||||
- golint
|
- golint
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
|
@ -13,5 +14,12 @@ issues:
|
||||||
- errcheck
|
- errcheck
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
|
depguard:
|
||||||
|
list-type: blacklist
|
||||||
|
include-go-root: true
|
||||||
|
packages:
|
||||||
|
- sync/atomic
|
||||||
|
packages-with-error-message:
|
||||||
|
- sync/atomic: "Use go.uber.org/atomic instead of sync/atomic"
|
||||||
errcheck:
|
errcheck:
|
||||||
exclude: scripts/errcheck_excludes.txt
|
exclude: scripts/errcheck_excludes.txt
|
||||||
|
|
Loading…
Reference in a new issue