aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-03-17 13:53:12 +0100
committerDaniel Stenberg <daniel@haxx.se>2015-03-17 13:57:37 +0100
commit0037eb58052b19bad7ce55b2317a19283c644637 (patch)
tree59d8ac20e4edbd7bb27e5addc07ae268ca0d256a /lib
parent9395999543eaad251d61a83b50f461cc29884cd2 (diff)
checksrc: introduce a whitelisting concept
Diffstat (limited to 'lib')
-rwxr-xr-xlib/checksrc.pl20
-rw-r--r--lib/checksrc.whitelist6
2 files changed, 26 insertions, 0 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl
index cd4314b51..190f00c93 100755
--- a/lib/checksrc.pl
+++ b/lib/checksrc.pl
@@ -26,13 +26,31 @@ my $indent = 2;
my $warnings;
my $errors;
+my $supressed; # whitelisted problems
my $file;
my $dir=".";
my $wlist;
+my %whitelist;
+
+sub readwhitelist {
+ open(W, "<checksrc.whitelist");
+ my @all=<W>;
+ for(@all) {
+ chomp;
+ $whitelist{$_}=1;
+ }
+ close(W);
+}
+
sub checkwarn {
my ($num, $col, $file, $line, $msg, $error) = @_;
+ if($whitelist{$line}) {
+ $supressed++;
+ return;
+ }
+
my $w=$error?"error":"warning";
if($w) {
@@ -78,6 +96,8 @@ if(!$file) {
exit;
}
+readwhitelist();
+
do {
if("$wlist" !~ / $file /) {
my $fullname = $file;
diff --git a/lib/checksrc.whitelist b/lib/checksrc.whitelist
new file mode 100644
index 000000000..da7b75dc0
--- /dev/null
+++ b/lib/checksrc.whitelist
@@ -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.