28 lines
792 B
Makefile
28 lines
792 B
Makefile
golangci_version=v1.59.0
|
|
|
|
#? setup-pre-commit: Set pre-commit git hook
|
|
setup-pre-commit:
|
|
@cp .git/hooks/pre-commit .git/hooks/pre-commit.bak 2>/dev/null || true
|
|
@echo "Installing pre-commit hook..."
|
|
@ln -sf ../../scripts/hooks/pre-commit.sh .git/hooks/pre-commit
|
|
@echo "Pre-commit hook installed successfully"
|
|
|
|
#? lint-install: Install golangci-lint
|
|
lint-install:
|
|
@echo "--> Installing golangci-lint $(golangci_version)"
|
|
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
|
|
|
|
#? lint: Run golangci-lint
|
|
lint:
|
|
@echo "--> Running linter"
|
|
$(MAKE) lint-install
|
|
@./scripts/go-lint-all.bash --timeout=15m
|
|
|
|
#? lint: Run golangci-lint and fix
|
|
lint-fix:
|
|
@echo "--> Running linter"
|
|
$(MAKE) lint-install
|
|
@./scripts/go-lint-all.bash --fix
|
|
|
|
.PHONY: lint lint-fix
|