From 0037eb58052b19bad7ce55b2317a19283c644637 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 17 Mar 2015 13:53:12 +0100 Subject: checksrc: introduce a whitelisting concept --- lib/checksrc.pl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/checksrc.pl') 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, "; + 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; -- cgit v1.2.3