mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: uti/lint/checkpatch: add --exclude to ignore specific directories
checkpatch: add option for excluding directories
when importing code from external sources
Using --exclude <dir> we should be able to exclude a list of well
defined locations in the tree that carry sources from other projects
with other styles.
This comes from the 01org/zephyr project in github:
Original-Change-Id: I7d321e85eed6bc37d5c6879ae88e21d20028a433
Original-Signed-off-by: Anas Nashif <anas.nashif@intel.com>
BUG=none
BRANCH=none
TEST=none
Change-Id: Ifdd76bc8f440e6cbb478fabd3b1a7bce55d1009f
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: a3cac87ea8
Original-Change-Id: Icc9e841e7d84026d6ab857ff90b0f093515ccaad
Original-Signed-off-by: Martin Roth <martinroth@google.com>
Original-Reviewed-on: https://review.coreboot.org/18568
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Original-Reviewed-by: Philippe Mathieu-Daud <philippe.mathieu.daude@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/452364
This commit is contained in:
parent
bba9f9855d
commit
7873f99314
1 changed files with 13 additions and 0 deletions
|
@ -45,6 +45,7 @@ my %use_type = ();
|
|||
my @use = ();
|
||||
my %ignore_type = ();
|
||||
my @ignore = ();
|
||||
my @exclude = ();
|
||||
my $help = 0;
|
||||
my $configuration_file = ".checkpatch.conf";
|
||||
my $max_line_length = 80;
|
||||
|
@ -86,6 +87,7 @@ Options:
|
|||
--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, if exceeded, warn
|
||||
--min-conf-desc-length=n set the min description length, if shorter, warn
|
||||
|
@ -190,6 +192,7 @@ GetOptions(
|
|||
'subjective!' => \$check,
|
||||
'strict!' => \$check,
|
||||
'ignore=s' => \@ignore,
|
||||
'exclude=s' => \@exclude,
|
||||
'types=s' => \@use,
|
||||
'show-types!' => \$show_types,
|
||||
'list-types!' => \$list_types,
|
||||
|
@ -2277,6 +2280,16 @@ sub process {
|
|||
$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: "
|
||||
|
|
Loading…
Add table
Reference in a new issue