chore: Enable bad regex gocritic linter (#14295)
This commit is contained in:
parent
edf230bc44
commit
5505a2150a
|
|
@ -81,6 +81,7 @@ linters-settings:
|
|||
- badCall
|
||||
- badCond
|
||||
- badLock
|
||||
- badRegexp
|
||||
- badSorting
|
||||
- builtinShadowDecl
|
||||
- caseOrder
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import (
|
|||
)
|
||||
|
||||
// Regular expression to see if a path element contains an origin
|
||||
var originPattern = regexp.MustCompile(`^([\w-_]+):`)
|
||||
var originPattern = regexp.MustCompile(`^([\w-]+):`)
|
||||
|
||||
type keySegment struct {
|
||||
name string
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ import (
|
|||
const DefaultTemplate = "host.tags.measurement.field"
|
||||
|
||||
var (
|
||||
compatibleAllowedCharsName = regexp.MustCompile(`[^ "-:\<>-\]_a-~\p{L}]`)
|
||||
compatibleAllowedCharsValue = regexp.MustCompile(`[^ -:<-~\p{L}]`)
|
||||
compatibleAllowedCharsName = regexp.MustCompile(`[^ "-:\<>-\]_a-~\p{L}]`) //nolint: gocritic // valid range for use-case
|
||||
compatibleAllowedCharsValue = regexp.MustCompile(`[^ -:<-~\p{L}]`) //nolint: gocritic // valid range for use-case
|
||||
compatibleLeadingTildeDrop = regexp.MustCompile(`^[~]*(.*)`)
|
||||
hyphenChars = strings.NewReplacer(
|
||||
"/", "-",
|
||||
|
|
|
|||
Loading…
Reference in New Issue