pre-commit.git-hook 686 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. #
  3. # To install this script, copy it to .git/hooks/pre-commit in local copy of
  4. # tor git repo and make sure it has permission to execute.
  5. #
  6. # This is pre-commit git hook script that prevents commiting your changeset if
  7. # it fails our code formatting or changelog entry formatting checkers.
  8. workdir=$(git rev-parse --show-toplevel)
  9. cd "$workdir" || exit 1
  10. python scripts/maint/lintChanges.py ./changes/*
  11. perl scripts/maint/checkSpace.pl -C \
  12. src/lib/*/*.[ch] \
  13. src/core/*/*.[ch] \
  14. src/feature/*/*.[ch] \
  15. src/app/*/*.[ch] \
  16. src/test/*.[ch] \
  17. src/test/*/*.[ch] \
  18. src/tools/*.[ch]
  19. if test -e scripts/maint/checkIncludes.py; then
  20. python scripts/maint/checkIncludes.py
  21. fi