From 06cd85bfcc23ffa8f7b09c4750c2a14c39f42361 Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Sat, 20 Aug 2016 16:25:11 +0000 Subject: [PATCH] pre-commit: add summary check by Markus (Forum #39854) git-svn-id: https://svn.fhem.de/fhem/trunk@12018 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/pre-commit | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fhem/contrib/pre-commit b/fhem/contrib/pre-commit index e4b9b5ce3..82977ddea 100755 --- a/fhem/contrib/pre-commit +++ b/fhem/contrib/pre-commit @@ -88,12 +88,20 @@ foreach my $row (split("\n", $fList)) { my $line = 0; my $docCount = 0; my $hasLink = 0; + my $hasSummary = 0; + while(my $l = ) { $line++; err $fName, "DOS line encoding is not supported." if($l =~ m/^=begin html$suffix.*\r/); + if($l =~ m/^=item summary$suffix\s+(.+?)\s*$/) { + err $fName, "$lang: summary is longer than 80 chars on line $line" + if(length($1) > 80); + $hasSummary = 1; + } + if($l =~ m/^=begin html$suffix$/) { $l = ; # skip one line, to be able to repeat join+split err($fName, "$lang: nonempty line after =begin html.") @@ -120,6 +128,9 @@ foreach my $row (split("\n", $fList)) { if(!$suffix && !$docCount); err $fName, "$lang: No link" if(!$suffix && $docCount && !$hasLink); + err $fName, "$lang: No summary description found" + if(!$suffix && $docCount && !$hasSummary); + foreach $tag (TAGS) { err $fName, "$lang: Unbalanced $tag ($tagcount{$tag}, last line ok: $llwct{$tag})" if($tagcount{$tag});