Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Put in your Rust repository's .git/hooks/pre-commit to ensure you never
- # breaks rustfmt.
- #
- # WARNING: rustfmt is a fast moving target so ensure you have the version that
- # all contributors have.
- for FILE in `git diff --cached --name-only`; do
- #if [[ $FILE == *.rs ]] && ! rustup run nightly rustfmt --write-mode diff --skip-children $FILE; then
- if [[ $FILE == *.rs ]] && ! rustfmt --write-mode diff --skip-children $FILE; then
- echo "Commit rejected due to invalid formatting of \"$FILE\" file."
- exit 1
- fi
- done
Add Comment
Please, Sign In to add comment