chore: improve pre-commit

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker
2021-07-24 21:21:22 -03:00
parent c63d704ce6
commit 2a304f5932
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ export GOPROXY = https://proxy.golang.org,direct
# Setup pre-commit hooks
dev:
ln -sf ./scripts/pre-commit.sh .git/hooks/pre-commit
cp -f scripts/pre-commit.sh .git/hooks/pre-commit
.PHONY: dev
# Install dependencies
+2 -2
View File
@@ -1,7 +1,7 @@
#!/bin/bash
FILES=$(git diff --staged --diff-filter=AM --no-renames --name-only)
FILES=$(git diff --cached --name-only --diff-filter=ACMR)
gofumpt -s -l -w $FILES
gofumpt -s -l -w .
golangci-lint run --new --fix
git add $FILES