mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-21 06:27:56 +01:00
add pre-push hook to check formatting
This commit is contained in:
parent
481649c8d2
commit
3078d5dab8
12
tools/git-pre-push-hook
Executable file
12
tools/git-pre-push-hook
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo -e "Checking code formatting:\n=========================\n\n" 1>&2
|
||||
|
||||
cargo fmt --check
|
||||
|
||||
if [[ $? -ne 0 ]]
|
||||
then
|
||||
o=$?
|
||||
echo -e "\n\nRun \`cargo fmt --all\` before pushing please." 1>&2
|
||||
exit $o
|
||||
fi
|
Loading…
Reference in New Issue
Block a user