mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 05:31:32 +00:00
patman: Support warnings in the patch subject
Sometimes checkpatch outputs problems in the patch subject. Add support for parsing this output and reporting it correctly. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
666eb15e92
commit
37f3bb53b7
1 changed files with 6 additions and 1 deletions
|
@ -127,6 +127,7 @@ def CheckPatch(fname, verbose=False):
|
||||||
warn_match = re_warning.match(line)
|
warn_match = re_warning.match(line)
|
||||||
file_match = re_file.match(line)
|
file_match = re_file.match(line)
|
||||||
check_match = re_check.match(line)
|
check_match = re_check.match(line)
|
||||||
|
subject_match = line.startswith('Subject:')
|
||||||
if err_match:
|
if err_match:
|
||||||
item['msg'] = err_match.group(1)
|
item['msg'] = err_match.group(1)
|
||||||
item['type'] = 'error'
|
item['type'] = 'error'
|
||||||
|
@ -139,6 +140,9 @@ def CheckPatch(fname, verbose=False):
|
||||||
elif file_match:
|
elif file_match:
|
||||||
item['file'] = file_match.group(1)
|
item['file'] = file_match.group(1)
|
||||||
item['line'] = int(file_match.group(2))
|
item['line'] = int(file_match.group(2))
|
||||||
|
elif subject_match:
|
||||||
|
item['file'] = '<patch subject>'
|
||||||
|
item['line'] = None
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@ -157,7 +161,8 @@ def GetWarningMsg(col, msg_type, fname, line, msg):
|
||||||
msg_type = col.Color(col.RED, msg_type)
|
msg_type = col.Color(col.RED, msg_type)
|
||||||
elif msg_type == 'check':
|
elif msg_type == 'check':
|
||||||
msg_type = col.Color(col.MAGENTA, msg_type)
|
msg_type = col.Color(col.MAGENTA, msg_type)
|
||||||
return '%s:%d: %s: %s\n' % (fname, line, msg_type, msg)
|
line_str = '' if line is None else '%d' % line
|
||||||
|
return '%s:%s: %s: %s\n' % (fname, line_str, msg_type, msg)
|
||||||
|
|
||||||
def CheckPatches(verbose, args):
|
def CheckPatches(verbose, args):
|
||||||
'''Run the checkpatch.pl script on each patch'''
|
'''Run the checkpatch.pl script on each patch'''
|
||||||
|
|
Loading…
Add table
Reference in a new issue