File tree 4 files changed +14
-9
lines changed
4 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,6 @@ cd api && npm ci
19
19
# TODO: if we need to, we should move this out of here and into `api/package.json`
20
20
21
21
22
- # Install the golang-lint
23
- # binary will be $(go env GOPATH)/bin/golangci-lint
24
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $( go env GOPATH) /bin v1.61.0
25
-
26
- golangci-lint --version
27
-
28
22
# Setup the welcome screen
29
23
echo " cat .devcontainer/motd" >> ~ /.bashrc
30
24
echo " cat .devcontainer/motd" >> ~ /.zshrc
Original file line number Diff line number Diff line change 45
45
- name : ' Lint'
46
46
uses : golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
47
47
with :
48
- version : ' v1.61.0'
48
+ # The repo's top-level Makefile parses the version of golangci-lint from here
49
+ version : v1.61.0
49
50
args : ' -v --build-tags=containers_image_openpgp $(go list -f '' {{.Dir}}/...'' -m | xargs)'
Original file line number Diff line number Diff line change @@ -12,3 +12,4 @@ node_modules
12
12
.idea
13
13
env
14
14
frontend /archive.tar.gz
15
+ tooling /bin
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ SHELL = /bin/bash
3
3
# This build tag is currently leveraged by tooling/image-sync
4
4
# https://github.com/containers/image?tab=readme-ov-file#building
5
5
GOTAGS? ='containers_image_openpgp'
6
+ TOOLS_BIN_DIR := tooling/bin
6
7
7
8
all : test lint
8
9
14
15
# There is currently no convenient way to run golangci-lint against a whole Go workspace
15
16
# https://github.com/golang/go/issues/50745
16
17
MODULES := $(shell go list -f '{{.Dir}}/...' -m | xargs)
17
- lint :
18
- golangci-lint run -v --build-tags=$(GOTAGS ) $(MODULES )
18
+ lint : $( GOLANGCI_LINT )
19
+ $( GOLANGCI_LINT ) run -v --build-tags=$(GOTAGS ) $(MODULES )
19
20
20
21
.PHONY : all clean lint test
22
+
23
+ GOLANGCI_LINT_BIN := golangci-lint
24
+ GOLANGCI_LINT_VER := $(shell cat .github/workflows/ci-go.yml | grep [[:space:]]version: | sed 's/.* version: //')
25
+ GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR ) /$(GOLANGCI_LINT_BIN ) -$(GOLANGCI_LINT_VER ) )
26
+
27
+ $(GOLANGCI_LINT ) : # Setup a repo-local golangci-lint in $(GOLANGCI_LINT)
28
+ $(shell curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(TOOLS_BIN_DIR ) $(GOLANGCI_LINT_VER ) )
29
+ $(shell mv $(TOOLS_BIN_DIR ) /$(GOLANGCI_LINT_BIN ) $(TOOLS_BIN_DIR ) /$(GOLANGCI_LINT_BIN ) -$(GOLANGCI_LINT_VER ) )
You can’t perform that action at this time.
0 commit comments