1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-27 08:38:07 +00:00
trezor-firmware/docs/git/hooks/pre-push

22 lines
549 B
Plaintext
Raw Normal View History

2019-01-08 16:22:43 +00:00
#!/bin/sh
# Runs a simple check before pushing. In particular, this checks
# if templates were regenerated and style is correct.
echo "Running pre-push git hook."
# Runs check for common simple errors before pushing
if ! pipenv run make templates_check &> /dev/null
2019-01-08 16:22:43 +00:00
then
echo >&2 "Templates not updated, run 'pipenv run make templates'. Not pushing."
2019-01-08 16:22:43 +00:00
exit 1
fi
if ! pipenv run make style_check &> /dev/null
2019-01-08 16:22:43 +00:00
then
echo >&2 "Style invalid, run 'pipenv run make style'. Not pushing."
2019-01-08 16:22:43 +00:00
exit 2
fi
echo "pre-push hook passed. Pushing."