Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit a186000

Browse files
authored
Merge pull request #62 from vshn/lint-ci
Run golangci-lint from makefile
2 parents c5f0d87 + 30fc2d2 commit a186000

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,3 @@ jobs:
2525
2626
- name: Run linters
2727
run: make lint
28-
29-
- name: golangci-lint
30-
uses: golangci/golangci-lint-action@v3
31-
with:
32-
version: latest

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ include Makefile.vars.mk
1717
# Optional kind module
1818
-include kind/kind.mk
1919

20+
golangci_bin = $(go_bin)/golangci-lint
21+
2022
.PHONY: help
2123
help: ## Show this help
2224
@grep -E -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
@@ -49,7 +51,11 @@ vet: ## Run 'go vet' against code
4951
go vet ./...
5052

5153
.PHONY: lint
52-
lint: fmt generate vet git-diff ## All-in-one linting
54+
lint: generate fmt golangci-lint git-diff ## All-in-one linting
55+
56+
.PHONY: golangci-lint
57+
golangci-lint: $(golangci_bin) ## Run golangci linters
58+
$(golangci_bin) run --timeout 5m --out-format colored-line-number ./...
5359

5460
.PHONY: git-diff
5561
git-diff:
@@ -64,3 +70,6 @@ generate: ## Generate additional code and artifacts
6470
clean: kind-clean ## Cleans local build artifacts
6571
docker rmi $(CONTAINER_IMG) || true
6672
rm -rf docs/node_modules $(docs_out_dir) dist .cache $(WORK_DIR)
73+
74+
$(golangci_bin): | $(go_bin)
75+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go_bin)"

0 commit comments

Comments
 (0)