Skip to content

Commit d400144

Browse files
committed
re-enable import sorting in generated code
When we switched to gci, all sorting was effectively disabled, even though from the Makefile it's clear that once "codegen" is done, "make imports" is supposed to run, hinting at a desire to have our generated code properly sorted. On-behalf-of: @SAP [email protected]
1 parent 9b69b2d commit d400144

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ linters-settings:
9292
- prefix(github.com/kcp-dev/kcp)
9393
- blank
9494
- dot
95-
skip-generated: true
95+
skip-generated: false
9696
gosec:
9797
excludes:
9898
- G307 # Deferring unsafe method "Close" on type "\*os.File"

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,11 @@ verify-codegen: ## Verify codegen
226226
.PHONY: imports
227227
imports: WHAT ?=
228228
imports: $(GOLANGCI_LINT) verify-go-versions
229-
@if [ -n "$(WHAT)" ]; then \
230-
$(GOLANGCI_LINT) run --enable-only=gci --fix --fast $(WHAT); \
229+
if [ -n "$(WHAT)" ]; then \
230+
$(GOLANGCI_LINT) run --enable-only=gci --fix --exclude-generated disable $(WHAT); \
231231
else \
232232
for MOD in . $$(git ls-files '**/go.mod' | sed 's,/go.mod,,'); do \
233-
(cd $$MOD; $(GOLANGCI_LINT) run --enable-only=gci --fix --fast); \
233+
(set -x; cd $$MOD; $(GOLANGCI_LINT) run --enable-only=gci --fix --exclude-generated disable); \
234234
done; \
235235
fi
236236

0 commit comments

Comments
 (0)