diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-01-16 14:31:13 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-01-19 11:02:34 +0000 |
commit | b9cce1a0babbb01e6a87250c0b273bff70bf2147 (patch) | |
tree | 93f642cb68e081153549218034157cabd8c188f4 /scripts | |
parent | 73475480f749628cc37880902ae34dd8b7480b27 (diff) |
Brush up task file conversion scripts
Modernize them by using f-strings and print out the issue count.
Make flake2tasks.py include the error number in the warning text.
Change-Id: I2d736c27dd3b2356e2b0d0d20f95112e7c37d3f9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/flake2tasks.py | 9 | ||||
-rwxr-xr-x | scripts/shiboken2tasks.py | 8 |
2 files changed, 11 insertions, 6 deletions
diff --git a/scripts/flake2tasks.py b/scripts/flake2tasks.py index f84ea8c71e..6b6517a2ff 100755 --- a/scripts/flake2tasks.py +++ b/scripts/flake2tasks.py @@ -14,7 +14,8 @@ import sys import re if __name__ == '__main__': - pattern = re.compile(r'^([^:]+):(\d+):\d+: E\d+ (.*)$') + pattern = re.compile(r'^([^:]+):(\d+):\d+: (.*)$') + n = 0 while True: line = sys.stdin.readline().rstrip() if not line: @@ -24,5 +25,7 @@ if __name__ == '__main__': file_name = match.group(1).replace('\\', '/') line_number = match.group(2) text = match.group(3) - output = "{}\t{}\twarn\t{}".format(file_name, line_number, text) - print(output) + print(f"{file_name}\t{line_number}\twarn\t{text}") + n += 1 + if n: + print(f"{n} issue(s) found.", file=sys.stderr) diff --git a/scripts/shiboken2tasks.py b/scripts/shiboken2tasks.py index d353c9c02f..6598d0ac71 100755 --- a/scripts/shiboken2tasks.py +++ b/scripts/shiboken2tasks.py @@ -16,6 +16,7 @@ if __name__ == '__main__': # qt.shiboken: (<module>) <file>:<line>:[<column>:] text # file might be c:\ on Windows pattern = re.compile(r'^qt\.shiboken: \(([^)]+)\) (..[^:]+):(\d+):(?:\d+:)? (.*)$') + n = 0 while True: line = sys.stdin.readline() if not line: @@ -26,6 +27,7 @@ if __name__ == '__main__': file_name = match.group(2).replace('\\', '/') line_number = match.group(3) text = match.group(4) - output = "{}\t{}\twarn\t{}: {}".format(file_name, line_number, - module, text) - print(output) + print(f"{file_name}\t{line_number}\twarn\t{module}: {text}") + n += 1 + if n: + print(f"{n} issue(s) found.", file=sys.stderr) |