[Libreoffice-commits] .: git-hooks/pre-commit

Miklos Vajna vmiklos at kemper.freedesktop.org
Wed Jan 19 16:57:27 PST 2011


 git-hooks/pre-commit |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit 5e7d47da56c9b35331756bcb915b23e2f14a62d6
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Thu Jan 20 00:16:32 2011 +0100

    git-hooks: warn about undocumented classes in new hxx files on commit

diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit
index b6581a4..cee3a7f 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 = "";


More information about the Libreoffice-commits mailing list