Guest User

Untitled

a guest
Dec 15th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Put in your Rust repository's .git/hooks/pre-commit to ensure you never
  4. # breaks rustfmt.
  5. #
  6. # WARNING: rustfmt is a fast moving target so ensure you have the version that
  7. # all contributors have.
  8.  
  9. for FILE in `git diff --cached --name-only`; do
  10. #if [[ $FILE == *.rs ]] && ! rustup run nightly rustfmt --write-mode diff --skip-children $FILE; then
  11. if [[ $FILE == *.rs ]] && ! rustfmt --write-mode diff --skip-children $FILE; then
  12. echo "Commit rejected due to invalid formatting of \"$FILE\" file."
  13.  
  14. exit 1
  15. fi
  16. done
Add Comment
Please, Sign In to add comment