Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: golangci-lint no docker #228

Merged
merged 2 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}
Loading