check-format.sh 476 B

12345678910111213141516171819202122232425
  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=()
  7. APPS+=( 'apps/emqx' 'apps/emqx_modules' )
  8. #APPS+=( 'lib-ee/emqx_license' )
  9. for app in "${APPS[@]}"; do
  10. echo "$app ..."
  11. ./scripts/format_app.py -a "$app" -f
  12. done
  13. DIFF_FILES="$(git diff --name-only)"
  14. if [ "$DIFF_FILES" != '' ]; then
  15. echo "ERROR: Below files need reformat"
  16. echo "$DIFF_FILES"
  17. exit 1
  18. fi