Skip to content

Commit

Permalink
ci: enforce that cachedregexp is always used instead of regexp (g…
Browse files Browse the repository at this point in the history
…oogle#663)

I did this as a bit of an exercise in how to configure linting a bit
more - while not critical, might as well have it and should help with
external contributors e.g. it'll flag google#658
  • Loading branch information
G-Rath authored Nov 17, 2023
1 parent 774df1d commit f37072f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ linters:
- testpackage # will re-add later (another-rex)
- goerr113 # will re-add later (another-rex)
- nonamedreturns # disagree with, for now (another-rex)
- depguard # not necessary at the moment (another-rex)
presets:
- bugs
- comment
Expand All @@ -42,6 +41,16 @@ linters:
- unused

linters-settings:
depguard:
rules:
regexp:
files:
- '!**/internal/cachedregexp/**'
- '!**/main_test.go'
deny:
- pkg: 'regexp'
desc:
'Use github.com/google/osv-scanner/internal/cachedregexp instead'
gocritic:
disabled-checks:
- ifElseChain
Expand Down

0 comments on commit f37072f

Please sign in to comment.