summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-01-17 16:52:23 -0700
committerSimon Glass <sjg@chromium.org>2017-02-08 06:07:35 -0700
commit8aa41363ebf46b9ff63b311bd2aa793c67a49def (patch)
tree83f5bdd28623954bccbaf9f3e02977eef50311df
parent6b6024a3a2e0297267ad8bc0ad1dd03d6d04265a (diff)
patman: Format checkpatch messages for IDE throwback
It is convenient to be able to deal with checkpatch warnings in the same way as build warnings. Tools such as emacs and kate can quickly locate the source file and line automatically. To achieve this, adjust the format to match the C compiler, and output to stderr. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--tools/patman/checkpatch.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/patman/checkpatch.py b/tools/patman/checkpatch.py
index be78fc510b..2915d97950 100644
--- a/tools/patman/checkpatch.py
+++ b/tools/patman/checkpatch.py
@@ -138,7 +138,7 @@ def GetWarningMsg(col, msg_type, fname, line, msg):
msg_type = col.Color(col.RED, msg_type)
elif msg_type == 'check':
msg_type = col.Color(col.MAGENTA, msg_type)
- return '%s: %s,%d: %s' % (msg_type, fname, line, msg)
+ return '%s:%d: %s: %s\n' % (fname, line, msg_type, msg)
def CheckPatches(verbose, args):
'''Run the checkpatch.pl script on each patch'''
@@ -157,7 +157,8 @@ def CheckPatches(verbose, args):
result.checks):
print("Internal error: some problems lost")
for item in result.problems:
- print(GetWarningMsg(col, item.get('type', '<unknown>'),
+ sys.stderr.write(
+ GetWarningMsg(col, item.get('type', '<unknown>'),
item.get('file', '<unknown>'),
item.get('line', 0), item.get('msg', 'message')))
print