diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2011-01-20 00:16:32 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@frugalware.org> | 2011-01-20 01:53:31 +0100 |
commit | 5e7d47da56c9b35331756bcb915b23e2f14a62d6 (patch) | |
tree | 010533c6a7f4409e0dcd5a96c5e081b34f9daec8 | |
parent | 3a1b3cc84ed3972339bb352573f98ba0f8770b95 (diff) |
git-hooks: warn about undocumented classes in new hxx files on commit
-rwxr-xr-x | git-hooks/pre-commit | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit index b6581a431..cee3a7f4a 100755 --- a/git-hooks/pre-commit +++ b/git-hooks/pre-commit @@ -8,6 +8,7 @@ use strict; use File::Temp qw/ :mktemp /; use File::Copy; +use Cwd; $ENV{LC_ALL} = "C"; @@ -119,6 +120,20 @@ EOM exit( 1 ); } +# check for missing doxygen comments in new files +my $doxycheck = "../../bin/find-undocumented-classes"; +if (! -e $doxycheck) { + # bootstrap repo + $doxycheck =~ s|../../||; +} +open(FILES, "git diff-index --cached --name-only --diff-filter=A $against |") || die "Cannot run git diff-index."; +while (my $file = <FILES>) { + chomp($file); + if ($file =~ /\.hxx$/) { + system("$doxycheck -q $file | sed 's|".getcwd()."/||;'"); + } +} + # be strict about tabs - we don't want them at all, setup your editor # correctly ;-) my $err_ext = ""; |