diff options
author | Tom Rini <trini@konsulko.com> | 2020-11-06 11:27:14 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-11-06 11:27:14 -0500 |
commit | 22ad69b7987eb4b10221330661db4427e40174fb (patch) | |
tree | b13bc4ba708907cd76a0ec09c4599b55cb586953 /tools/patman/checkpatch.py | |
parent | 896cc5aa4a8fc0c28036b9615a37f0034addad44 (diff) | |
parent | dc4b2a9770b5b932cd6d98c33ebff6dc46de6849 (diff) |
Merge tag 'dm-pull5nov20' of git://git.denx.de/u-boot-dm
patman status subcommand to collect tags from Patchwork
patman showing email replies from Patchwork
sandbox poweroff command
minor fixes in binman, tests
Diffstat (limited to 'tools/patman/checkpatch.py')
-rw-r--r-- | tools/patman/checkpatch.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tools/patman/checkpatch.py b/tools/patman/checkpatch.py index 263bac3fc90..63a8e37e8c5 100644 --- a/tools/patman/checkpatch.py +++ b/tools/patman/checkpatch.py @@ -93,8 +93,9 @@ def CheckPatch(fname, verbose=False, show_types=False): re_error = re.compile('ERROR:%s (.*)' % type_name) re_warning = re.compile(emacs_prefix + 'WARNING:%s (.*)' % type_name) re_check = re.compile('CHECK:%s (.*)' % type_name) - re_file = re.compile('#\d+: FILE: ([^:]*):(\d+):') + 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: @@ -150,8 +153,13 @@ def CheckPatch(fname, verbose=False, show_types=False): item['msg'] = check_match.group(2) item['type'] = 'check' elif file_match: - item['file'] = file_match.group(1) - item['line'] = int(file_match.group(2)) + err_fname = file_match.group(3) + if err_fname: + item['file'] = err_fname + item['line'] = int(file_match.group(4)) + else: + item['file'] = '<patch>' + item['line'] = int(file_match.group(1)) elif subject_match: item['file'] = '<patch subject>' item['line'] = None |