2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

pre-commit: fixed version

git-svn-id: https://svn.fhem.de/fhem/trunk@10334 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-01-02 15:40:28 +00:00
parent 794282941d
commit aaf9d04563

View File

@ -12,9 +12,7 @@ my $arg="-t $txn";
#my $arg="-r $txn"; # local testing #my $arg="-r $txn"; # local testing
my @lang = ("EN", "DE"); my @lang = ("EN", "DE");
my $exitCode = 0; my $exitCode = 0;
use constant TAGS => qw{ul li code b i u table tr td}; use constant TAGS => qw{ul li code b i u td tr table};
use constant LINECHECK => qw{CHANGED};
my $log = `$svnlook log $arg $repos`; my $log = `$svnlook log $arg $repos`;
if($log !~ m/^.*:.*$/s) { if($log !~ m/^.*:.*$/s) {
@ -32,23 +30,29 @@ foreach my $row (split("\n", $fList)) {
chomp($row); chomp($row);
my ($type, $fName) = split(" ", $row); my ($type, $fName) = split(" ", $row);
next if($type eq "D"); next if($type eq "D");
next if(!$fName || !grep($fName, LINECHECK) || $fName !~ m+FHEM/\d\d_(.*).pm$+); next if(!$fName);
my $modName = $1;
# check for 80 chars per line conformity # check for 80 chars per line conformity
if(grep($fName, LINECHECK)) { if($fName =~ m/CHANGED/) {
my $cCount = 0; my ($cCount, $cLineNo, $lineNo) = (0,0,0);
open(FILE, "$svnlook $arg cat $repos $fName|") || open(FILE, "$svnlook $arg cat $repos $fName|") ||
die("Cant svnlook cat $fName:$!\n"); die("Cant svnlook cat $fName:$!\n");
while(my $l = <FILE>) { while(my $l = <FILE>) {
chomp $l; chomp $l;
$cCount = length($l) if(length($l) > $cCount); $lineNo++;
if(length($l) > $cCount) {
$cCount = length($l);
$cLineNo = $lineNo;
}
} }
close(FILE); close(FILE);
err $fName, "$fName: file has over 80 chars/line" if($cCount > 80); err $fName, "$fName: file has over 80 chars/line in line $cLineNo"
if($cCount > 80);
next; next;
} }
next if($fName !~ m+FHEM/\d\d_(.*).pm$+);
my $modName = $1;
foreach my $lang (@lang) { foreach my $lang (@lang) {
my $suffix = ($lang eq "EN" ? "" : "_$lang"); my $suffix = ($lang eq "EN" ? "" : "_$lang");
my $tag; my $tag;