Skip to content

Commit 06aa5d8

Browse files
authored
Implement lint/go command for local (#4086)
1 parent 95c1e5d commit 06aa5d8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ manifests/helloworld/charts
5858

5959
# gomock generated reflect files
6060
gomock_reflect_*/
61+
62+
# Cache
63+
.cache

Makefile

+8-1
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,15 @@ run/site:
138138
# Lint commands
139139

140140
.PHONY: lint/go
141+
lint/go: FIX ?= false
142+
lint/go: VERSION ?= sha256:78d1bbd01a9886a395dc8374218a6c0b7b67694e725dd76f0c8ac1de411b85e8 #v1.46.2
143+
lint/go: FLAGS ?= --rm -e GOLANGCI_LINT_CACHE=/repo/.cache/golangci-lint -v ${PWD}:/repo -w /repo -it
141144
lint/go:
142-
@echo "Unimplemented"
145+
ifeq ($(FIX),true)
146+
docker run ${FLAGS} golangci/golangci-lint@${VERSION} golangci-lint run --fix
147+
else
148+
docker run ${FLAGS} golangci/golangci-lint@${VERSION} golangci-lint run
149+
endif
143150

144151
.PHONY: lint/web
145152
lint/web: FIX ?= false

0 commit comments

Comments
 (0)