mirror of https://github.com/moparisthebest/curl
checksrc: exit error code if warnings or errors
This commit is contained in:
parent
9869668884
commit
92f722017c
|
@ -5,11 +5,21 @@ my $file=$ARGV[0];
|
||||||
my $max_column = 79;
|
my $max_column = 79;
|
||||||
my $indent = 2;
|
my $indent = 2;
|
||||||
|
|
||||||
|
my $warnings;
|
||||||
|
my $errors;
|
||||||
|
|
||||||
sub checkwarn {
|
sub checkwarn {
|
||||||
my ($num, $col, $file, $line, $msg, $error) = @_;
|
my ($num, $col, $file, $line, $msg, $error) = @_;
|
||||||
|
|
||||||
my $w=$error?"error":"warning";
|
my $w=$error?"error":"warning";
|
||||||
|
|
||||||
|
if($w) {
|
||||||
|
$warnings++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$errors++;
|
||||||
|
}
|
||||||
|
|
||||||
$col++;
|
$col++;
|
||||||
print "$file:$num:$col: $w: $msg\n";
|
print "$file:$num:$col: $w: $msg\n";
|
||||||
print " $line\n";
|
print " $line\n";
|
||||||
|
@ -116,3 +126,7 @@ if(!$copyright) {
|
||||||
}
|
}
|
||||||
|
|
||||||
close(R);
|
close(R);
|
||||||
|
|
||||||
|
if($errors || $warnings) {
|
||||||
|
exit 5; # return failure
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue