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 | 142a314a70931738bf49911d0e2d7bfdbf5494cb (patch) | |
tree | 1ed54a14a482bcc9302eefb44c8d075fc91efc26 /git-hooks | |
parent | 2ce4895f860e3d8b7c301e8cbc479d7b352e6c38 (diff) |
git-hooks: warn about undocumented classes in new hxx files on commit
Diffstat (limited to 'git-hooks')
-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 b6581a431989..cee3a7f4ac8a 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 = ""; |