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:
parent
f37c045052
commit
3b6d12656d
5
Makefile
5
Makefile
@ -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
7
scripts/pre-commit.sh
Executable 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
|
Loading…
x
Reference in New Issue
Block a user