Skip to content

Commit 71c9cbc

Browse files
chore(lint): update import grouping for preflight repo in golangci config
- Change gci import prefix to github.com/jetstack/preflight in .golangci.yaml - Add makefile hack to set repo_name for golangci-lint config generation - Document workaround until go module can be renamed Signed-off-by: Richard Wall <[email protected]>
1 parent 950537c commit 71c9cbc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ formatters:
8181
sections:
8282
- standard # Standard section: captures all standard packages.
8383
- default # Default section: contains all imports that could not be matched to another section type.
84-
- prefix(github.com/jetstack/jetstack-secure) # Custom section: groups all imports with the specified Prefix.
84+
- prefix(github.com/jetstack/preflight) # Custom section: groups all imports with the specified Prefix.
8585
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
8686
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
8787
exclusions:

make/00_mod.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
repo_name := github.com/jetstack/jetstack-secure
2+
# TODO(wallrj): This is a hack to allow use the old preflight repo name in the
3+
# gci section of the golangci-lint config until we can rename the go module.
4+
# Without this hack, golangci-lint will complain that the
5+
# github.com/jetstack/preflight imports should be grouped with all the other
6+
# third-party modules.
7+
generate-golangci-lint-config: repo_name := github.com/jetstack/preflight
28

39
license_ignore := gitlab.com/venafi,github.com/jetstack
410

0 commit comments

Comments
 (0)