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

Run golangci-lint from makefile #62

Merged
merged 1 commit into from
Oct 26, 2022
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
5 changes: 0 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,3 @@ jobs:

- name: Run linters
run: make lint

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ include Makefile.vars.mk
# Optional kind module
-include kind/kind.mk

golangci_bin = $(go_bin)/golangci-lint

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

.PHONY: lint
lint: fmt generate vet git-diff ## All-in-one linting
lint: generate fmt golangci-lint git-diff ## All-in-one linting

.PHONY: golangci-lint
golangci-lint: $(golangci_bin) ## Run golangci linters
$(golangci_bin) run --timeout 5m --out-format colored-line-number ./...

.PHONY: git-diff
git-diff:
Expand All @@ -64,3 +70,6 @@ generate: ## Generate additional code and artifacts
clean: kind-clean ## Cleans local build artifacts
docker rmi $(CONTAINER_IMG) || true
rm -rf docs/node_modules $(docs_out_dir) dist .cache $(WORK_DIR)

$(golangci_bin): | $(go_bin)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go_bin)"