diff mbox series

[v3,22/29] patman: Don't ignore lines starting with hash

Message ID 20201030034638.2858999-23-sjg@chromium.org
State Accepted
Commit b5e188131f048ad57420545c7e867e80d60b835b
Delegated to: Simon Glass
Headers show
Series patman: Collect review tags and comments from Patchwork | expand

Commit Message

Simon Glass Oct. 30, 2020, 3:46 a.m. UTC
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>
---

(no changes since v1)

 tools/patman/checkpatch.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Simon Glass Nov. 3, 2020, 11:02 p.m. UTC | #1
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>
---

(no changes since v1)

 tools/patman/checkpatch.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/tools/patman/checkpatch.py b/tools/patman/checkpatch.py
index 263bac3fc90..98d962cd50d 100644
--- a/tools/patman/checkpatch.py
+++ b/tools/patman/checkpatch.py
@@ -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: