Skip to content

Commit 2121d6b

Browse files
Merge pull request #468 from erikgb/gci-localmodule
Simplify GCI golangci-lint config with localmodule
2 parents 3206f89 + a732d53 commit 2121d6b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

modules/go/.golangci.override.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,11 @@ formatters:
7070
enable: [ gci, gofmt ]
7171
settings:
7272
gci:
73+
custom-order: true
7374
sections:
7475
- standard # Standard section: captures all standard packages.
7576
- default # Default section: contains all imports that could not be matched to another section type.
76-
- prefix({{REPO-NAME}}) # Custom section: groups all imports with the specified Prefix.
77+
- localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
7778
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
7879
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
7980
exclusions:

modules/go/01_mod.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ generate-golangci-lint-config: | $(NEEDS_GOLANGCI-LINT) $(NEEDS_YQ) $(bin_dir)/s
117117
cp $(golangci_lint_config) $(bin_dir)/scratch/golangci-lint.yaml.tmp
118118
$(YQ) -i 'del(.linters.enable)' $(bin_dir)/scratch/golangci-lint.yaml.tmp
119119
$(YQ) eval-all -i '. as $$item ireduce ({}; . * $$item)' $(bin_dir)/scratch/golangci-lint.yaml.tmp $(golangci_lint_override)
120-
$(YQ) -i '(.. | select(tag == "!!str")) |= sub("{{REPO-NAME}}", "$(repo_name)")' $(bin_dir)/scratch/golangci-lint.yaml.tmp
121120
mv $(bin_dir)/scratch/golangci-lint.yaml.tmp $(golangci_lint_config)
122121

123122
shared_generate_targets += generate-golangci-lint-config

0 commit comments

Comments
 (0)