1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 03:18:09 +00:00

Merge pull request #450 from trezor/tsusanka/git-hook

Add git pre-push hook to docs
This commit is contained in:
Jan Pochyla 2019-01-09 15:33:16 +01:00 committed by GitHub
commit 2b429a85ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

22
docs/git/hooks/pre-push Normal file
View File

@ -0,0 +1,22 @@
#!/bin/sh
# Runs a simple check before pushing. In particular, this checks
# if templates were regenerated and style is correct.
# Put this file to `.git/hooks/`.
echo "Running pre-push git hook."
# Runs check for common simple errors before pushing
if ! make templates_check &> /dev/null
then
echo >&2 "Templates not updated, run 'make templates'. Not pushing."
exit 1
fi
if ! make style &> /dev/null
then
echo >&2 "Style invalid, run style make commands. Not pushing."
exit 2
fi
echo "pre-push hook passed. Pushing."