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

build: Make make lint faster #1774

Merged
merged 2 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 6 additions & 10 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@ jobs:
golangci:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copied from workflows, the action has it's own cache

name: lint
runs-on: ubuntu-latest
timeout-minutes: 10
env:
GOPATH: /home/runner/go
steps:
- uses: actions/checkout@v3
- name: Setup Golang
uses: actions/[email protected]
with:
go-version: "1.17.1"
- name: Add to PATH
run: |
echo /home/runner/go/bin >> $GITHUB_PATH
- name: golangci-lint
run: |
echo 'GOPATH=/home/runner/go' >> $GITHUB_ENV
make lint
fetch-depth: 0
- uses: golangci/golangci-lint-action@v2
- run: git diff --exit-code
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
run:
timeout: 5m
skip-dirs:
- pkg/client
- vendor
Expand Down Expand Up @@ -29,4 +28,3 @@ linters:
- unused
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I felt like there were a lot of linters, but lets see how it works

- varcheck
- whitespace

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ start: image
kubectl -n argo-events wait --for=condition=Ready --timeout 60s pod --all

$(GOPATH)/bin/golangci-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin v1.44.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use latest

curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin

.PHONY: lint
lint: $(GOPATH)/bin/golangci-lint
go mod tidy
golangci-lint run --fix --verbose --concurrency 4 --timeout 5m
golangci-lint run --fix --verbose

# release - targets only available on release branch
ifneq ($(findstring release,$(GIT_BRANCH)),)
Expand Down