Skip to content
Snippets Groups Projects
Commit 6a698150 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

checksrc: add -W to allow a file to be whitelisted

Useful when a known file just doesn't comply and there's no intention to
make it do so.
parent 889d1e97
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@ my $warnings;
my $errors;
my $file;
my $dir=".";
my $wlist;
sub checkwarn {
my ($num, $col, $file, $line, $msg, $error) = @_;
......@@ -53,21 +54,35 @@ sub checkwarn {
$file = shift @ARGV;
if($file =~ /-D(.*)/) {
$dir = $1;
$file = shift @ARGV;
while(1) {
if($file =~ /-D(.*)/) {
$dir = $1;
$file = shift @ARGV;
next;
}
elsif($file =~ /-W(.*)/) {
$wlist = $1;
$file = shift @ARGV;
next;
}
last;
}
if(!$file) {
print "checksrc.pl [option] <file1> [file2] ...\n";
print " Options:\n";
print " -D[DIR] Directory to prepend file names\n";
print " -W[file] Whitelist the given file - ignore all its flaws\n";
exit;
}
do {
scanfile("$dir/$file");
if($file ne "$wlist") {
scanfile("$dir/$file");
}
$file = shift @ARGV;
} while($file);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment