Skip to content

Commit 687a924

Browse files
committed
feat(gitlab-ci): Lint using a version configurable golangci-lint image
1 parent ba91ad2 commit 687a924

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

cookiecutter.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"origin": null,
55
"image": "n",
66
"use_ci": ["gitlab", "circleci", "none"],
7-
"go": "1.11.1",
7+
"go": "1.17.10",
8+
"golangcilint_version": "v1.45.0",
89
"module": "{{ cookiecutter.origin }}"
910
}

{{cookiecutter.name}}/build/ci/.gitlab-ci.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,11 @@ test:
3636
# Runs code linting
3737
lint:
3838
stage: test
39-
image: golang:{{cookiecutter.go}}-alpine
4039
variables:
41-
GOLANGCILINT_VERSION: v1.21.0
40+
GOLANGCILINT_VERSION: {{cookiecutter.golangcilint_version}}
41+
image: golangci/golangci-lint:${GOLANGCILINT_VERSION}-alpine
4242
script:
43-
- apk update && apk add build-base git
44-
- go mod download
45-
- wget -O - -q https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s ${GOLANGCILINT_VERSION}
46-
- ./bin/golangci-lint run
43+
- golangci-lint run -c ../.golangci.yml
4744

4845
# Runs dependency vetting
4946
# https://github.com/sonatype-nexus-community/nancy

0 commit comments

Comments
 (0)