check_clang-format.sh 340 B

123456789101112131415161718
  1. #!/usr/bin/env bash
  2. set -e
  3. function checkclean {
  4. if [ $(svn status | wc -l) -ne 0 ]; then
  5. return 1
  6. fi
  7. return 0
  8. }
  9. checkclean || ( echo "error: Working copy not clean" ; exit 1 )
  10. ./build/svn/run_clang-format.sh
  11. checkclean || ( echo "warning: Formatting does not adhere to enforced clang-format rules." ; svn diff )
  12. svn revert -R .