File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,9 +87,18 @@ formatters:
8787 enable :
8888 - gofmt
8989 - goimports
90+ - gci
9091 settings :
9192 gofmt :
9293 simplify : true
94+ # Local addition on top of org standard: repo-specific import grouping
95+ gci :
96+ custom-order : true
97+ sections :
98+ - standard
99+ - default
100+ - prefix(github.com/openshift-hyperfleet)
101+ - prefix(github.com/openshift-hyperfleet/hyperfleet-sentinel)
93102 exclusions :
94103 generated : lax
95104 paths :
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ include .bingo/Variables.mk
33.DEFAULT_GOAL := help
44
55GO ?= go
6- GOFMT ?= gofmt
76
87# Schema variant for OpenAPI generation (core, gcp)
98VARIANT ?= core
@@ -113,18 +112,19 @@ test-coverage: test ## Run tests and show coverage
113112# #@ Code Quality
114113
115114.PHONY : fmt
116- fmt : # # Format Go code
117- $(GOFMT ) -s -w .
115+ fmt : # # Format Go code and imports
116+ $(GOLANGCI_LINT ) fmt ./.. .
118117
119118.PHONY : gofmt
120119gofmt : fmt # # Alias for fmt
121120
122121.PHONY : fmt-check
123122fmt-check : # # Check if code is formatted
124- @diff=$$($(GOFMT ) -s -d .) ; \
123+ @diff=$$($(GOLANGCI_LINT ) fmt --diff ./... 2>&1) || { echo " $$ diff " ; echo " golangci-lint fmt failed " ; exit 1 ; } ; \
125124 if [ -n " $$ diff" ]; then \
126- echo " Code is not formatted. Run 'make fmt' to fix:" ; \
127- echo " $$ diff" ; \
125+ echo " $$ diff" >&2 ; \
126+ echo " " ; \
127+ echo " Code is not formatted. Run 'make fmt' to fix." ; \
128128 exit 1; \
129129 fi
130130
You can’t perform that action at this time.
0 commit comments