Skip to content

Commit

Permalink
chore: golangci-lint no docker (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
fracasula committed Nov 23, 2023
1 parent fb71ca8 commit 080bc69
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54.2
version: v1.55.2
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ install-tools:
go install mvdan.cc/gofumpt@latest
go install gotest.tools/gotestsum@v1.8.2
go install golang.org/x/tools/cmd/goimports@latest
bash ./internal/scripts/install-golangci-lint.sh v1.55.2

.PHONY: lint
lint: fmt ## Run linters on all go files
docker run --rm -v $(shell pwd):/app:ro -w /app golangci/golangci-lint:v1.54.2 bash -e -c \
'golangci-lint run -v --timeout 5m'
golangci-lint run -v --timeout 5m

.PHONY: fmt
fmt: install-tools ## Formats all go files
Expand Down
7 changes: 7 additions & 0 deletions internal/scripts/install-golangci-lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
VERSION=$1
[ -z "${VERSION}" ] && VERSION="v1.55.2"
GOPATH=$(go env GOPATH)
[ -f "${GOPATH}/bin/golangci-lint-${VERSION}" ] && echo "golangci-lint ${VERSION} is already installed" || \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/${VERSION}/install.sh | sh -s -- -b ${GOPATH}/bin ${VERSION} && \
cp ${GOPATH}/bin/golangci-lint ${GOPATH}/bin/golangci-lint-${VERSION}

0 comments on commit 080bc69

Please sign in to comment.