Skip to content

Commit

Permalink
Merge pull request #4315 from tstromberg/lintersss
Browse files Browse the repository at this point in the history
Fallback to golangci-lint v1.16.0 if necessary, quiet test.sh output
  • Loading branch information
tstromberg authored May 22, 2019
2 parents 119d650 + bb82039 commit 52d177d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,16 @@ vet:

# Once v1.16.1+ is released, replace with
# curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh \
# | bash -s -- -b out/linters v1.16.0

# | bash -s -- -b out/linters v1.16.1
out/linters/golangci-lint:
mkdir -p out/linters \
&& cd out/linters \
&& test -f go.mod || go mod init linters \
&& go get -u github.com/golangci/golangci-lint/cmd/golangci-lint@692dacb773b703162c091c2d8c59f9cd2d6801db >/dev/null
mkdir -p out/linters
cd out/linters
test -f go.mod || go mod init linters
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint@692dacb773b703162c091c2d8c59f9cd2d6801db 2>&1 \
| grep -v "go: finding"
test -x $(GOPATH)/bin/golangci-lint \
|| curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh \
| sh -s -- -b $(GOPATH)/bin v1.16.0
cp -f $(GOPATH)/bin/golangci-lint out/linters/golangci-lint

.PHONY: lint
Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set -eu -o pipefail
exitcode=0

echo "= go mod ================================================================"
go mod download >/dev/null || ((exitcode+=1))
go mod download 2>&1 | grep -v "go: finding" || true
go mod tidy -v && echo ok || ((exitcode+=2))

echo "= make lint ============================================================="
Expand Down

0 comments on commit 52d177d

Please sign in to comment.