diff options
author | Oliver Smith <osmith@sysmocom.de> | 2021-07-07 10:47:09 +0200 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2021-07-07 11:28:16 +0200 |
commit | 57804faaccd55b3ee4e90d1ea776768269cfe4a7 (patch) | |
tree | 952712d48f225cc38b774086ec1684258925b1c6 | |
parent | d58b999e0f8ea2ae8f744192589f3e3923e1da6d (diff) |
lint: checkpatch.pl: exclude pattern, not dir
Allow to exclude files in a follow-up commit, not just directories.
Related: OS#5087
Change-Id: Ic3990fba60060c331c479174183924b9cdbdb4c8
-rwxr-xr-x | lint/checkpatch/checkpatch.pl | 4 | ||||
-rwxr-xr-x | lint/checkpatch/checkpatch_osmo.sh | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lint/checkpatch/checkpatch.pl b/lint/checkpatch/checkpatch.pl index 2cd5402..dc56812 100755 --- a/lint/checkpatch/checkpatch.pl +++ b/lint/checkpatch/checkpatch.pl @@ -105,7 +105,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 + --exclude PATTERN(,P2...) exclude pattern --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 @@ -2811,7 +2811,7 @@ sub process { my $skipme = 0; foreach (@exclude) { - if ($realfile =~ m@^(?:$_/)@) { + if ($realfile =~ m@$_@) { $skipme = 1; } } diff --git a/lint/checkpatch/checkpatch_osmo.sh b/lint/checkpatch/checkpatch_osmo.sh index 0a5c65f..bdbd125 100755 --- a/lint/checkpatch/checkpatch_osmo.sh +++ b/lint/checkpatch/checkpatch_osmo.sh @@ -2,7 +2,7 @@ SCRIPT_DIR="$(dirname "$(realpath "$0")")" # Excluded paths: -# * lint/checkpath: so it does not warn about spelling errors in spelling.txt :) +# * ^lint/checkpatch/: so it does not warn about spelling errors in spelling.txt :) # Ignored checks: # * ASSIGN_IN_IF: not followed (e.g. 'if ((u8 = gsup_msg->cause))') @@ -23,7 +23,7 @@ SCRIPT_DIR="$(dirname "$(realpath "$0")")" # * STRING_FRAGMENTS: sometimes used intentionally to improve readability $SCRIPT_DIR/checkpatch.pl \ - --exclude lint/checkpatch \ + --exclude '^lint/checkpatch/' \ --ignore ASSIGN_IN_IF \ --ignore AVOID_EXTERNS \ --ignore BLOCK_COMMENT_STYLE \ |