summaryrefslogtreecommitdiffstats
path: root/tools/patman
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-05-06 16:29:07 -0600
committerSimon Glass <sjg@chromium.org>2020-06-11 20:52:11 -0600
commit666eb15e923e93872dbca1b834ce123a327fc9b3 (patch)
treed2e2fbf65caeeafad7b82495db5b8c2a3f948588 /tools/patman
parent7175b085e1213c99fbc237483b33cd52ff00f891 (diff)
downloadu-boot-666eb15e923e93872dbca1b834ce123a327fc9b3.tar.gz
u-boot-666eb15e923e93872dbca1b834ce123a327fc9b3.tar.xz
u-boot-666eb15e923e93872dbca1b834ce123a327fc9b3.zip
patman: Handle checkpatch output with notes and code
If checkpatch is configured to output code we should ignore it. Similarly, notes should be ignored. Update the logic to handle these situations. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman')
-rw-r--r--tools/patman/checkpatch.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/patman/checkpatch.py b/tools/patman/checkpatch.py
index 2cfa9778c6..5426bb9e9e 100644
--- a/tools/patman/checkpatch.py
+++ b/tools/patman/checkpatch.py
@@ -85,7 +85,8 @@ def CheckPatch(fname, verbose=False):
re_warning = re.compile(emacs_prefix + 'WARNING:(?:[A-Z_]+:)? (.*)')
re_check = re.compile('CHECK: (.*)')
re_file = re.compile('#\d+: FILE: ([^:]*):(\d+):')
-
+ re_note = re.compile('NOTE: (.*)')
+ indent = ' ' * 6
for line in result.stdout.splitlines():
if verbose:
print(line)
@@ -96,6 +97,14 @@ def CheckPatch(fname, verbose=False):
result.problems.append(item)
item = {}
continue
+ if re_note.match(line):
+ continue
+ # Skip lines which quote code
+ if line.startswith(indent):
+ continue
+ # Skip code quotes and #<n>
+ if line.startswith('+') or line.startswith('#'):
+ continue
match = re_stats_full.match(line)
if not match:
match = re_stats.match(line)