refactor: add make lint git hook (#19075)
This commit is contained in:
parent
7685abb885
commit
ad04bfede0
7
Makefile
7
Makefile
@ -386,6 +386,13 @@ benchmark:
|
||||
|
||||
golangci_version=v1.55.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)"
|
||||
|
||||
4
scripts/hooks/pre-commit.sh
Executable file
4
scripts/hooks/pre-commit.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
# lint modified go files
|
||||
golangci-lint run --fix --new -c .golangci.yml
|
||||
Loading…
Reference in New Issue
Block a user