Skip to content

Commit 8f99c15

Browse files
authored
Add linter rules to ensure we don't accidentally emit metrics directly instead of through the compat package (#633)
1 parent 7650cd0 commit 8f99c15

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.golangci-lint.yml

+12
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,25 @@ linters-settings:
99
check-shadowing: true
1010
golint:
1111
min-confidence: 0
12+
depguard:
13+
rules:
14+
main:
15+
list-mode: lax
16+
allow:
17+
- "github.com/hashicorp/go-metrics/compat"
18+
deny:
19+
- pkg: "github.com/hashicorp/go-metrics"
20+
desc: not allowed, use github.com/hashicorp/go-metrics/compat instead
21+
- pkg: "github.com/armon/go-metrics"
22+
desc: not allowed, use github.com/hashicorp/go-metrics/compat instead
1223

1324
linters:
1425
disable-all: true
1526
enable:
1627
- gofmt
1728
#- golint
1829
- govet
30+
- depguard
1931
#- varcheck
2032
#- typecheck
2133
#- gosimple

0 commit comments

Comments
 (0)