diff options
author | Daniel Stenberg <daniel@haxx.se> | 2011-04-25 22:43:02 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2011-04-27 09:09:35 +0200 |
commit | 6a6981503e509a2bfcec0763535c0f667e23ce38 (patch) | |
tree | a4706599cd47a2d03d8e6048dc8b9371f6e1dc9b | |
parent | 889d1e973fb718a77c5000141d724ce03863af23 (diff) |
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.
-rwxr-xr-x | lib/checksrc.pl | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl index aa06e84c5..c1056d26c 100755 --- a/lib/checksrc.pl +++ b/lib/checksrc.pl @@ -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); |