Skip to content

Commit ee19af4

Browse files
authored
Install pre-built golangci-lint release (#36)
1 parent 93e3ed9 commit ee19af4

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ linters:
22
enable-all: true
33
disable:
44
- lll
5+
- wsl
6+
- gomnd
57

68
issues:
9+
exclude-use-default: true
710
exclude:
811
# Triggered by table tests calling t.Run. See
912
# https://github.com/kyoh86/scopelint/issues/4 for more information.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $(go-junit-report):
2323
# Install binary for golangci-lint.
2424
golangci-lint := $(GOBIN)/golangci-lint
2525
$(golangci-lint):
26-
cd /tmp && go get -u github.com/golangci/golangci-lint/cmd/golangci-lint@v1.18.0
26+
@./scripts/install-golangci-lint $(golangci-lint)
2727

2828
# Install binary for goimports.
2929
goimports := $(GOBIN)/goimports

scripts/install-golangci-lint

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
set -eu
3+
4+
platform="$(uname -s)"
5+
if [ "$platform" = Linux ]; then
6+
prefix=golangci-lint-1.23.8-linux-amd64
7+
elif [ "$platform" = Darwin ]; then
8+
prefix=golangci-lint-1.23.8-darwin-amd64
9+
fi
10+
11+
cd "$(mktemp -d)" || exit 1
12+
wget -q "https://github.com/golangci/golangci-lint/releases/download/v1.23.8/${prefix}.tar.gz"
13+
tar -xf "${prefix}.tar.gz"
14+
mkdir -p "$(dirname "$1")"
15+
install "${prefix}/golangci-lint" "$1"
16+
rm -rf "$PWD"

0 commit comments

Comments
 (0)