]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
patman: Don't ignore lines starting with hash
authorSimon Glass <sjg@chromium.org>
Fri, 30 Oct 2020 03:46:31 +0000 (21:46 -0600)
committerSimon Glass <sjg@chromium.org>
Thu, 5 Nov 2020 16:11:31 +0000 (09:11 -0700)
These lines can indicate a continuation of an error and should not be
ignored. Fix this.

Fixes: 666eb15e923 ("patman: Handle checkpatch output with notes and code")
Signed-off-by: Simon Glass <sjg@chromium.org>
tools/patman/checkpatch.py

index 263bac3fc90d72a475e52a68d508ed8f1900f7ff..98d962cd50d3e0f92d1b0619b56a91623a7b6cff 100644 (file)
@@ -95,6 +95,7 @@ def CheckPatch(fname, verbose=False, show_types=False):
     re_check = re.compile('CHECK:%s (.*)' % type_name)
     re_file = re.compile('#\d+: FILE: ([^:]*):(\d+):')
     re_note = re.compile('NOTE: (.*)')
+    re_new_file = re.compile('new file mode .*')
     indent = ' ' * 6
     for line in result.stdout.splitlines():
         if verbose:
@@ -111,8 +112,10 @@ def CheckPatch(fname, verbose=False, show_types=False):
         # Skip lines which quote code
         if line.startswith(indent):
             continue
-        # Skip code quotes and #<n>
-        if line.startswith('+') or line.startswith('#'):
+        # Skip code quotes
+        if line.startswith('+'):
+            continue
+        if re_new_file.match(line):
             continue
         match = re_stats_full.match(line)
         if not match: