checksrc: introduce a whitelisting concept
This commit is contained in:
@@ -26,13 +26,31 @@ my $indent = 2;
|
|||||||
|
|
||||||
my $warnings;
|
my $warnings;
|
||||||
my $errors;
|
my $errors;
|
||||||
|
my $supressed; # whitelisted problems
|
||||||
my $file;
|
my $file;
|
||||||
my $dir=".";
|
my $dir=".";
|
||||||
my $wlist;
|
my $wlist;
|
||||||
|
|
||||||
|
my %whitelist;
|
||||||
|
|
||||||
|
sub readwhitelist {
|
||||||
|
open(W, "<checksrc.whitelist");
|
||||||
|
my @all=<W>;
|
||||||
|
for(@all) {
|
||||||
|
chomp;
|
||||||
|
$whitelist{$_}=1;
|
||||||
|
}
|
||||||
|
close(W);
|
||||||
|
}
|
||||||
|
|
||||||
sub checkwarn {
|
sub checkwarn {
|
||||||
my ($num, $col, $file, $line, $msg, $error) = @_;
|
my ($num, $col, $file, $line, $msg, $error) = @_;
|
||||||
|
|
||||||
|
if($whitelist{$line}) {
|
||||||
|
$supressed++;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
my $w=$error?"error":"warning";
|
my $w=$error?"error":"warning";
|
||||||
|
|
||||||
if($w) {
|
if($w) {
|
||||||
@@ -78,6 +96,8 @@ if(!$file) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readwhitelist();
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if("$wlist" !~ / $file /) {
|
if("$wlist" !~ / $file /) {
|
||||||
my $fullname = $file;
|
my $fullname = $file;
|
||||||
|
|||||||
6
lib/checksrc.whitelist
Normal file
6
lib/checksrc.whitelist
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
227 Entering Passive Mode (a1,a2,a3,a4,p1,p2)
|
||||||
|
228 Entering Long Passive Mode (4,4,a1,a2,a3,a4,2,p1,p2)
|
||||||
|
150 ASCII data connection for /bin/ls (137.167.104.91,37445) (0 bytes).
|
||||||
|
150 Opening ASCII mode data connection for [file] (0.0.0.0,0) (545 bytes)
|
||||||
|
* no_proxy=domain1.dom,host.domain2.dom
|
||||||
|
Default values are (0,0) initialized by calloc.
|
||||||
3
src/checksrc.whitelist
Normal file
3
src/checksrc.whitelist
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
* 'name=@filename,filename2,filename3'
|
||||||
|
* 'name=@filename;type=image/gif,filename2,filename3'
|
||||||
|
|
||||||
Reference in New Issue
Block a user