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
|
2019-08-02 08:38:36 +00:00
|
|
|
echo ""
|
|
|
|
echo "Checking templates"
|
2020-09-25 14:21:23 +00:00
|
|
|
if ! poetry run make templates_check
|
2019-01-08 16:22:43 +00:00
|
|
|
then
|
2020-09-25 14:21:23 +00:00
|
|
|
echo >&2 "Templates not updated, run 'poetry run make templates'. Not pushing."
|
2019-01-08 16:22:43 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-08-02 08:38:36 +00:00
|
|
|
echo ""
|
|
|
|
echo "Checking style"
|
2020-09-25 14:21:23 +00:00
|
|
|
if ! poetry run make style_check
|
2019-01-08 16:22:43 +00:00
|
|
|
then
|
2020-09-25 14:21:23 +00:00
|
|
|
echo >&2 "Style invalid, run 'poetry run make style'. Not pushing."
|
2019-01-08 16:22:43 +00:00
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "pre-push hook passed. Pushing."
|