mirror of https://codeberg.org/topola/topola.git
githooks: add pre-commit hook with dry `cargo fmt`
This commit is contained in:
parent
81e316397f
commit
4596ec6a7d
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
diff=$(cargo fmt -- --check)
|
||||
result=$?
|
||||
|
||||
if [ ${result} -ne 0 ]; then
|
||||
echo "There are some code formatting issues, run `cargo fmt` first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Loading…
Reference in New Issue