Change in osmo-ci[master]: lint/checkpatch: add --exclude argument

osmith gerrit-no-reply at lists.osmocom.org
Wed Jun 16 15:43:03 UTC 2021


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/24700 )


Change subject: lint/checkpatch: add --exclude argument
......................................................................

lint/checkpatch: add --exclude argument

Apply patch from https://review.coreboot.org/c/coreboot/+/18568/, so we
can exclude specific directories.

Related: OS#5087
Change-Id: Ia980814895249f839873c5002f0d21c0e59ee01d
---
M lint/checkpatch/checkpatch.pl
1 file changed, 13 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/00/24700/1

diff --git a/lint/checkpatch/checkpatch.pl b/lint/checkpatch/checkpatch.pl
index 23697a6..2cd5402 100755
--- a/lint/checkpatch/checkpatch.pl
+++ b/lint/checkpatch/checkpatch.pl
@@ -54,6 +54,7 @@
 my @use = ();
 my %ignore_type = ();
 my @ignore = ();
+my @exclude = ();
 my $help = 0;
 my $configuration_file = ".checkpatch.conf";
 my $max_line_length = 100;
@@ -104,6 +105,7 @@
   --list-types               list the possible message types
   --types TYPE(,TYPE2...)    show only these comma separated message types
   --ignore TYPE(,TYPE2...)   ignore various comma separated message types
+  --exclude DIR(,DIR22...)   exclude directories
   --show-types               show the specific message type in the output
   --max-line-length=n        set the maximum line length, (default $max_line_length)
                              if exceeded, warn on patches
@@ -301,6 +303,7 @@
 	'subjective!'	=> \$check,
 	'strict!'	=> \$check,
 	'ignore=s'	=> \@ignore,
+	'exclude=s'	=> \@exclude,
 	'types=s'	=> \@use,
 	'show-types!'	=> \$show_types,
 	'list-types!'	=> \$list_types,
@@ -2806,6 +2809,16 @@
 			$found_file = 1;
 		}
 
+		my $skipme = 0;
+		foreach (@exclude) {
+			if ($realfile =~ m@^(?:$_/)@) {
+				$skipme = 1;
+			}
+		}
+		if ($skipme) {
+			next;
+		}
+
 #make up the handle for any error we report on this line
 		if ($showfile) {
 			$prefix = "$realfile:$realline: "

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/24700
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ia980814895249f839873c5002f0d21c0e59ee01d
Gerrit-Change-Number: 24700
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210616/39a47a59/attachment.htm>


More information about the gerrit-log mailing list