Skip to content

Commit

Permalink
Add dprint check to pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
khssnv committed Dec 8, 2023
1 parent eb8488d commit 9909a81
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/pre-commit.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/bin/sh

# Prevent committing badly formatted code

cargo fmt -- --check
if [ $? -ne 0 ]; then
echo "Run \`cargo fmt\` to fix formatting issues before committing."
exit 1
fi

dprint check
if [ $? -ne 0 ]; then
echo "Run \`dprint fmt\` to fix formatting issues before committing."
exit 1
fi

0 comments on commit 9909a81

Please sign in to comment.