[Concept,10/22] buildman: Fix docstring in add_line_prefix()
Commit Message
From: Simon Glass <simon.glass@canonical.com>
Add missing 'brds' parameter documentation and add type annotations
to fix pylint W9015/W9016 warnings. Also fix typo 'training' to
'trailing'.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---
tools/buildman/test.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
@@ -287,16 +287,17 @@ class TestBuild(unittest.TestCase):
def add_line_prefix(prefix, brds, error_str, colour):
"""Add a prefix to each line of a string
- The training \n in error_str is removed before processing
+ The trailing newline in error_str is removed before processing
Args:
- prefix: String prefix to add
- error_str: Error string containing the lines
- colour: Expected colour for the line. Note that the board list,
- if present, always appears in magenta
+ prefix (str): String prefix to add
+ brds (str): Board names to include in the output
+ error_str (str): Error string containing the lines
+ colour (int): Expected colour for the line. Note that the board
+ list, if present, always appears in magenta
Returns:
- New string where each line has the prefix added
+ str: New string where each line has the prefix added
"""
lines = error_str.strip().splitlines()
new_lines = []