check-format.sh 427 B

123456789101112131415161718192021
  1. #!/usr/bin/env bash
  2. ## Used in CI. this scripts wraps format_app.py
  3. ## and check git diff
  4. set -euo pipefail
  5. cd -P -- "$(dirname -- "$0")/.."
  6. APPS="$(./scripts/find-apps.sh | xargs)"
  7. for app in ${APPS}; do
  8. echo "$app ..."
  9. ./scripts/format_app.py -a "$app" -f
  10. done
  11. DIFF_FILES="$(git diff --name-only)"
  12. if [ "$DIFF_FILES" != '' ]; then
  13. echo "ERROR: Below files need reformat"
  14. echo "$DIFF_FILES"
  15. exit 1
  16. fi