From 5e7d47da56c9b35331756bcb915b23e2f14a62d6 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 20 Jan 2011 00:16:32 +0100 Subject: git-hooks: warn about undocumented classes in new hxx files on commit --- git-hooks/pre-commit | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 = ) { + 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 = ""; -- cgit v1.2.3