golangci-lint: add forbidigo rules to prevent regex.MustCompile
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
ced66f22d6
commit
4c820d3ac0
@ -7,6 +7,7 @@ linters:
|
|||||||
- dupword # Detects duplicate words.
|
- dupword # Detects duplicate words.
|
||||||
- durationcheck
|
- durationcheck
|
||||||
- errchkjson
|
- errchkjson
|
||||||
|
- forbidigo
|
||||||
- gocritic # Metalinter; detects bugs, performance, and styling issues.
|
- gocritic # Metalinter; detects bugs, performance, and styling issues.
|
||||||
- gocyclo
|
- gocyclo
|
||||||
- gofumpt # Detects whether code was gofumpt-ed.
|
- gofumpt # Detects whether code was gofumpt-ed.
|
||||||
@ -66,6 +67,11 @@ linters-settings:
|
|||||||
desc: Use github.com/google/uuid instead.
|
desc: Use github.com/google/uuid instead.
|
||||||
- pkg: "io/ioutil"
|
- pkg: "io/ioutil"
|
||||||
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
|
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
|
||||||
|
forbidigo:
|
||||||
|
forbid:
|
||||||
|
- pkg: ^regexp$
|
||||||
|
p: ^regexp\.MustCompile
|
||||||
|
msg: Use internal/lazyregexp.New instead.
|
||||||
gocyclo:
|
gocyclo:
|
||||||
min-complexity: 16
|
min-complexity: 16
|
||||||
gosec:
|
gosec:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user