This makes finding the warning and error marks much easier. Signed-off-by: Aaron Conole <acon...@redhat.com> --- utilities/checkpatch.py | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py index 17e5be4..ed53f32 100755 --- a/utilities/checkpatch.py +++ b/utilities/checkpatch.py @@ -21,10 +21,17 @@ import sys __errors = 0 __warnings = 0 +print_file_name = None +def print_file(): + global print_file_name + if print_file_name: + print("In file %s" % print_file_name) + print_file_name = None def print_error(message, lineno=None): global __errors + print_file() if lineno is not None: print("E(%d): %s" % (lineno, message)) else: @@ -35,6 +42,7 @@ def print_error(message, lineno=None): def print_warning(message, lineno=None): global __warnings + print_file() if lineno: print("W(%d): %s" % (lineno, message)) else: @@ -131,6 +139,7 @@ def if_and_for_end_with_bracket_check(line): def ovs_checkpatch_parse(text): + global print_file_name lineno = 0 signatures = [] co_authors = [] @@ -185,6 +194,7 @@ def ovs_checkpatch_parse(text): newfile = hunks.match(line) if newfile: current_file = newfile.group(2) + print_file_name = current_file continue if not is_added_line(line): continue -- 2.7.4 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev