File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ SKIP_GOLANGCI_LINT :=
62
62
GOLANGCI_LINT :=
63
63
GOLANGCI_LINT_OPTS ?=
64
64
GOLANGCI_LINT_VERSION ?= v2.1.5
65
+ GOLANGCI_FMT_OPTS ?=
65
66
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
66
67
# windows isn't included here because of the path separator being different.
67
68
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
@@ -156,9 +157,13 @@ $(GOTEST_DIR):
156
157
@mkdir -p $@
157
158
158
159
.PHONY: common-format
159
- common-format:
160
+ common-format: $(GOLANGCI_LINT)
160
161
@echo ">> formatting code"
161
162
$(GO) fmt $(pkgs)
163
+ ifdef GOLANGCI_LINT
164
+ @echo ">> formatting code with golangci-lint"
165
+ $(GOLANGCI_LINT) fmt $(GOLANGCI_FMT_OPTS)
166
+ endif
162
167
163
168
.PHONY: common-vet
164
169
common-vet:
@@ -248,8 +253,8 @@ $(PROMU):
248
253
cp $(PROMU_TMP)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM)/promu $(FIRST_GOPATH)/bin/promu
249
254
rm -r $(PROMU_TMP)
250
255
251
- .PHONY: proto
252
- proto:
256
+ .PHONY: common- proto
257
+ common- proto:
253
258
@echo ">> generating code from proto files"
254
259
@./scripts/genproto.sh
255
260
You can’t perform that action at this time.
0 commit comments