1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-26 04:22:05 +02:00

chore: pre-commit hook

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker 2021-07-24 21:04:28 -03:00
parent f37c045052
commit 3b6d12656d
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
2 changed files with 12 additions and 0 deletions

View File

@ -7,6 +7,11 @@ export PATH := ./bin:$(PATH)
export GO111MODULE := on
export GOPROXY = https://proxy.golang.org,direct
# Setup pre-commit hooks
dev:
ln -sf ./scripts/pre-commit.sh .git/hooks/pre-commit
.PHONY: dev
# Install dependencies
setup:
go mod tidy

7
scripts/pre-commit.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
FILES=$(git diff --staged --diff-filter=AM --no-renames --name-only)
gofumpt -s -l -w $FILES
golangci-lint run --new --fix
git add $FILES