Skip to content

Commit

Permalink
Update golangci-lint to ignore gomock generated files
Browse files Browse the repository at this point in the history
The regex filter in skip-files is intended to exclude any packages with name containing "gomock*".
This is because the linter config importa specifically excludes package imports that include _.
See [importas analyzer code](https://github.com/julz/importas/blob/e9218386d3f4cd0421d099009f2fdc209269fc22/analyzer.go#L60)
  • Loading branch information
s-fairchild committed Feb 7, 2024
1 parent 015b342 commit 5d7506c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ run:
skip-dirs:
- vendor/portal
- vendor
skip-files:
- '.*\/gomock.*\/.*go$'
skip-dirs-use-default: true
modules-download-mode: vendor
build-tags:
Expand All @@ -12,6 +14,9 @@ run:
- "exclude_graphdriver_btrfs"
go: "1.18"

output:
format: github-actions

issues:
max-same-issues: 0
exclude-rules:
Expand Down Expand Up @@ -145,6 +150,8 @@ linters-settings:

- pkg: "^github\\.com/Azure/ARO-RP/pkg/api/(v[^/]*[0-9])$"
alias: $1
- pkg: "^github\\.com/Azure/ARO-RP/pkg/util/(v[^/]*[0-9])$"
alias: $1
- pkg: "^github\\.com/Azure/ARO-RP/pkg/client/services/redhatopenshift/mgmt/([0-9]+)-([0-9]+)-([0-9]+)-?(preview)?/redhatopenshift$"
alias: mgmtredhatopenshift$1$2$3$4
- pkg: "^github\\.com/Azure/ARO-RP/pkg/(dbtoken|deploy|gateway|mirror|monitor|operator|portal)$"
Expand Down

0 comments on commit 5d7506c

Please sign in to comment.