Skip to content

Commit

Permalink
Add Makefile w/ Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
joelsmith-2019 committed May 10, 2024
1 parent 4b4524c commit 19b6127
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
with:
go-version: '1.21'
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6.0.1
with:
version: v1.57.2
- name: run linting
run: |
make lint
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
golangci_lint_cmd=golangci-lint
golangci_version=v1.57.2

default: help
help: ## Prints this help message
@echo "Available make commands:"; grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: lint
lint: ## Lint the repository
@echo "--> Running linter"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
@$(golangci_lint_cmd) run ./... --timeout 15m

.PHONY: lint-fix
lint-fix: ## Lint the repository and fix warnings (if applicable)
@echo "--> Running linter and fixing issues"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
@$(golangci_lint_cmd) run ./... --fix --timeout 15m

0 comments on commit 19b6127

Please sign in to comment.