diff options
author | Michael Mann <mmann78@netscape.net> | 2014-11-07 22:53:41 -0500 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-11-08 07:23:42 +0000 |
commit | 570df7592d1f6a38b28438192536f8c4872e8437 (patch) | |
tree | 99bd201a9c9e12f5db0bb5d89f8f8ba82416418b /tools | |
parent | 48885cc1bcbfdf909918d0927df34fee57e13f39 (diff) |
Add checkfiltername.pl to pre-commit script
Change-Id: I34d8aa7034a4aacc2a95b35a30f25356b33a51b9
Reviewed-on: https://code.wireshark.org/review/5187
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/checkfiltername.pl | 9 | ||||
-rwxr-xr-x | tools/pre-commit | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/tools/checkfiltername.pl b/tools/checkfiltername.pl index 6f8a0f2bd4..8256945910 100755 --- a/tools/checkfiltername.pl +++ b/tools/checkfiltername.pl @@ -104,8 +104,6 @@ my $showall = 0; my $comment = 0; -my $error = 0; - sub checkprotoabbrev { my $abbrev = ""; my $abbrevpos; @@ -695,7 +693,10 @@ while (<>) { &printprevfile(); -print "\n\nTOTAL ERRORS: $totalerrorcount"; +if ($totalerrorcount > 0) { + print "\n\nTOTAL ERRORS: $totalerrorcount"; +} + if ($filecount > 1) { print " ($errorfilecount files)\n"; @@ -742,6 +743,6 @@ if ($filecount > 1) { print "\n"; -exit $error; +exit (($totalerrorcount == 0) ? 0 : 1); # exit 1 if ERROR __END__ diff --git a/tools/pre-commit b/tools/pre-commit index d48357baef..aa34474c88 100755 --- a/tools/pre-commit +++ b/tools/pre-commit @@ -30,6 +30,9 @@ for FILE in `git diff-index --cached --name-status HEAD | grep -v "^D" | cut -f2 #Check if fix-encoding-args is good ./tools/fix-encoding-args.pl $FILE || exit_status=1 + #Check if checkfiltername is good + ./tools/checkfiltername.pl $FILE || exit_status=1 + done # If there are whitespace errors, print the offending file names and fail. (from git pre-commit.sample) |