diff options
| -rwxr-xr-x | BuildTools/Git/Hooks/pre-commit | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/BuildTools/Git/Hooks/pre-commit b/BuildTools/Git/Hooks/pre-commit index ad0945e..987f127 100755 --- a/BuildTools/Git/Hooks/pre-commit +++ b/BuildTools/Git/Hooks/pre-commit | |||
| @@ -2,22 +2,27 @@ | |||
| 2 | 2 | ||
| 3 | IFS=' | 3 | IFS=' |
| 4 | ' | 4 | ' |
| 5 | 5 | ||
| 6 | echo "Checking tabs & copyrights ..." | 6 | echo "Checking tabs & copyrights ..." |
| 7 | for file in $(git diff --cached --diff-filter=A --name-only); do | ||
| 8 | if [ ! -f $file ]; then | ||
| 9 | continue | ||
| 10 | fi | ||
| 11 | if ! BuildTools/Copyrighter.py check-copyright $file; then | ||
| 12 | echo "ERROR: '$file' has a copyright error. Aborting commit." | ||
| 13 | exit -1 | ||
| 14 | fi | ||
| 15 | done | ||
| 7 | for file in $(git diff --cached --name-only); do | 16 | for file in $(git diff --cached --name-only); do |
| 8 | if [ ! -f $file ]; then | 17 | if [ ! -f $file ]; then |
| 9 | continue | 18 | continue |
| 10 | fi | 19 | fi |
| 11 | if ! BuildTools/CheckTabs.py $file; then | 20 | if ! BuildTools/CheckTabs.py $file; then |
| 12 | echo "ERROR: '$file' contains expanded tabs. Aborting commit." | 21 | echo "ERROR: '$file' contains expanded tabs. Aborting commit." |
| 13 | exit -1 | 22 | exit -1 |
| 14 | fi | 23 | fi |
| 15 | if ! BuildTools/Copyrighter.py check-copyright $file; then | ||
| 16 | echo "ERROR: '$file' has a copyright error. Aborting commit." | ||
| 17 | exit -1 | ||
| 18 | fi | ||
| 19 | if ! BuildTools/CheckHeaders.py $file; then | 24 | if ! BuildTools/CheckHeaders.py $file; then |
| 20 | echo "ERROR: '$file' failed header sanity test. Aborting commit." | 25 | echo "ERROR: '$file' failed header sanity test. Aborting commit." |
| 21 | exit -1 | 26 | exit -1 |
| 22 | fi | 27 | fi |
| 23 | done | 28 | done |
Swift