Skip to content

Commit

Permalink
fix: .git-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
trakhimenok committed Aug 21, 2024
1 parent 96a9e20 commit ca32429
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .git-hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
# To setup git hooks run:
# > git config core.hooksPath .git-hooks || echo 'Not in a git repo'
echo "Running .git-hooks/pre-commit..."
if git diff --name-only --cached | grep -q ":\s*go\.mod"; then
gomodlint
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi
fi
go fmt ./...
go build ./...
go test ./...
golangci-lint run

0 comments on commit ca32429

Please sign in to comment.