chore(pre-commit): move rustfmt hook to `.pre-commit-config.yaml`

This commit is contained in:
Mikolaj Wielgus 2024-10-06 04:25:23 +02:00
parent d0058ef5fd
commit 04fda44d4b
2 changed files with 5 additions and 11 deletions

View File

@ -1,11 +0,0 @@
#!/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

5
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,5 @@
repos:
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt