File tree Expand file tree Collapse file tree 5 files changed +14
-22
lines changed Expand file tree Collapse file tree 5 files changed +14
-22
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ linters:
41
41
- unused
42
42
- usestdlibvars
43
43
- whitespace
44
+ - forbidigo
44
45
45
46
exclusions :
46
47
paths :
@@ -169,6 +170,19 @@ linters:
169
170
- float-compare
170
171
- go-require
171
172
enable-all : true
173
+ forbidigo :
174
+ analyze-types : true
175
+ forbid :
176
+ - pattern : ^.*model\.NameValidationScheme$
177
+ pkg : ^github.com/prometheus/common/model$
178
+ msg : it is deprecated. Use model/validation.NamingScheme instead.
179
+ - pattern : ^.*model\.LabelName\.IsValid$
180
+ pkg : ^github.com/prometheus/common/model$
181
+ msg : it depends on model.NameValidationScheme. Use model/validation.NamingScheme instead.
182
+ - pattern : ^.*model\.IsValidMetricName$
183
+ pkg : ^github.com/prometheus/common/model$
184
+ msg : it depends on model.NameValidationScheme. Use model/validation.NamingScheme instead.
185
+
172
186
173
187
output :
174
188
show-stats : false
Original file line number Diff line number Diff line change @@ -141,10 +141,6 @@ var (
141
141
)
142
142
143
143
func init () {
144
- // This can be removed when the legacy global mode is fully deprecated.
145
- //nolint:staticcheck
146
- model .NameValidationScheme = model .UTF8Validation
147
-
148
144
prometheus .MustRegister (versioncollector .NewCollector (strings .ReplaceAll (appName , "-" , "_" )))
149
145
150
146
var err error
Original file line number Diff line number Diff line change @@ -46,12 +46,6 @@ import (
46
46
"github.com/prometheus/prometheus/util/testutil"
47
47
)
48
48
49
- func init () {
50
- // This can be removed when the legacy global mode is fully deprecated.
51
- //nolint:staticcheck
52
- model .NameValidationScheme = model .UTF8Validation
53
- }
54
-
55
49
const startupTime = 10 * time .Second
56
50
57
51
var (
Original file line number Diff line number Diff line change @@ -63,12 +63,6 @@ import (
63
63
64
64
var promqlEnableDelayedNameRemoval = false
65
65
66
- func init () {
67
- // This can be removed when the legacy global mode is fully deprecated.
68
- //nolint:staticcheck
69
- model .NameValidationScheme = model .UTF8Validation
70
- }
71
-
72
66
const (
73
67
successExitCode = 0
74
68
failureExitCode = 1
Original file line number Diff line number Diff line change @@ -39,12 +39,6 @@ import (
39
39
"github.com/prometheus/prometheus/promql/promqltest"
40
40
)
41
41
42
- func init () {
43
- // This can be removed when the legacy global mode is fully deprecated.
44
- //nolint:staticcheck
45
- model .NameValidationScheme = model .UTF8Validation
46
- }
47
-
48
42
var promtoolPath = os .Args [0 ]
49
43
50
44
func TestMain (m * testing.M ) {
You can’t perform that action at this time.
0 commit comments