mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-14 09:20:55 +00:00
docs: move git hooks to core docs and update
This commit is contained in:
parent
7e822854c2
commit
baaba41447
7
docs/git/hooks/README.md
Normal file
7
docs/git/hooks/README.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Git hooks
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
Copy these files to `.git/hooks/` to activate them. Run in root:
|
||||||
|
|
||||||
|
`cp docs/git/hooks/* .git/hooks/`
|
@ -2,20 +2,19 @@
|
|||||||
|
|
||||||
# Runs a simple check before pushing. In particular, this checks
|
# Runs a simple check before pushing. In particular, this checks
|
||||||
# if templates were regenerated and style is correct.
|
# if templates were regenerated and style is correct.
|
||||||
# Put this file to `.git/hooks/`.
|
|
||||||
|
|
||||||
echo "Running pre-push git hook."
|
echo "Running pre-push git hook."
|
||||||
|
|
||||||
# Runs check for common simple errors before pushing
|
# Runs check for common simple errors before pushing
|
||||||
if ! make templates_check &> /dev/null
|
if ! pipenv run make templates_check &> /dev/null
|
||||||
then
|
then
|
||||||
echo >&2 "Templates not updated, run 'make templates'. Not pushing."
|
echo >&2 "Templates not updated, run 'pipenv run make templates'. Not pushing."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! make style_check &> /dev/null
|
if ! pipenv run make style_check &> /dev/null
|
||||||
then
|
then
|
||||||
echo >&2 "Style invalid, run style make commands. Not pushing."
|
echo >&2 "Style invalid, run 'pipenv run make style'. Not pushing."
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user