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:
4141 - unused
4242 - usestdlibvars
4343 - whitespace
44+ - forbidigo
4445
4546 exclusions :
4647 paths :
@@ -169,6 +170,19 @@ linters:
169170 - float-compare
170171 - go-require
171172 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+
172186
173187output :
174188 show-stats : false
Original file line number Diff line number Diff line change @@ -141,10 +141,6 @@ var (
141141)
142142
143143func init () {
144- // This can be removed when the legacy global mode is fully deprecated.
145- //nolint:staticcheck
146- model .NameValidationScheme = model .UTF8Validation
147-
148144 prometheus .MustRegister (versioncollector .NewCollector (strings .ReplaceAll (appName , "-" , "_" )))
149145
150146 var err error
Original file line number Diff line number Diff line change @@ -46,12 +46,6 @@ import (
4646 "github.com/prometheus/prometheus/util/testutil"
4747)
4848
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-
5549const startupTime = 10 * time .Second
5650
5751var (
Original file line number Diff line number Diff line change @@ -63,12 +63,6 @@ import (
6363
6464var promqlEnableDelayedNameRemoval = false
6565
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-
7266const (
7367 successExitCode = 0
7468 failureExitCode = 1
Original file line number Diff line number Diff line change @@ -39,12 +39,6 @@ import (
3939 "github.com/prometheus/prometheus/promql/promqltest"
4040)
4141
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-
4842var promtoolPath = os .Args [0 ]
4943
5044func TestMain (m * testing.M ) {
You can’t perform that action at this time.
0 commit comments