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

Commit

Permalink
Merge pull request #62 from vshn/lint-ci
Browse files Browse the repository at this point in the history
Run golangci-lint from makefile
  • Loading branch information
ccremer committed Oct 26, 2022
2 parents c5f0d87 + 30fc2d2 commit a186000
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
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)"

0 comments on commit a186000

Please sign in to comment.