diff options
author | Simon Glass <sjg@chromium.org> | 2022-01-29 14:14:17 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2022-02-09 12:30:13 -0700 |
commit | 252ac589969acbc4c17379a4e862a18e1518d12d (patch) | |
tree | c17e36e0f9590e6de59f812066e6649c22be0000 /tools/patman/checkpatch.py | |
parent | 82e0e732ee2cf6d0e125aeb7ed7de69711f35ec8 (diff) |
patman: Rename Color() method to build()
This method has the same name as its class which is confusing. It is also
annoying when searching the code.
It builds a string with a colour, so rename it to build().
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/checkpatch.py')
-rw-r--r-- | tools/patman/checkpatch.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/patman/checkpatch.py b/tools/patman/checkpatch.py index 043419089a..dd792efee0 100644 --- a/tools/patman/checkpatch.py +++ b/tools/patman/checkpatch.py @@ -228,11 +228,11 @@ def get_warning_msg(col, msg_type, fname, line, msg): msg: Message to report ''' if msg_type == 'warning': - msg_type = col.Color(col.YELLOW, msg_type) + msg_type = col.build(col.YELLOW, msg_type) elif msg_type == 'error': - msg_type = col.Color(col.RED, msg_type) + msg_type = col.build(col.RED, msg_type) elif msg_type == 'check': - msg_type = col.Color(col.MAGENTA, msg_type) + msg_type = col.build(col.MAGENTA, msg_type) line_str = '' if line is None else '%d' % line return '%s:%s: %s: %s\n' % (fname, line_str, msg_type, msg) @@ -248,7 +248,7 @@ def check_patches(verbose, args): warning_count += result.warnings check_count += result.checks print('%d errors, %d warnings, %d checks for %s:' % (result.errors, - result.warnings, result.checks, col.Color(col.BLUE, fname))) + result.warnings, result.checks, col.build(col.BLUE, fname))) if (len(result.problems) != result.errors + result.warnings + result.checks): print("Internal error: some problems lost") @@ -266,6 +266,6 @@ def check_patches(verbose, args): color = col.YELLOW if error_count: color = col.RED - print(col.Color(color, str % (error_count, warning_count, check_count))) + print(col.build(color, str % (error_count, warning_count, check_count))) return False return True |