forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -14,7 +14,8 @@ import sys
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
pattern = re.compile(r'^([^:]+):(\d+):\d+: E\d+ (.*)$')
|
pattern = re.compile(r'^([^:]+):(\d+):\d+: (.*)$')
|
||||||
|
n = 0
|
||||||
while True:
|
while True:
|
||||||
line = sys.stdin.readline().rstrip()
|
line = sys.stdin.readline().rstrip()
|
||||||
if not line:
|
if not line:
|
||||||
@@ -24,5 +25,7 @@ if __name__ == '__main__':
|
|||||||
file_name = match.group(1).replace('\\', '/')
|
file_name = match.group(1).replace('\\', '/')
|
||||||
line_number = match.group(2)
|
line_number = match.group(2)
|
||||||
text = match.group(3)
|
text = match.group(3)
|
||||||
output = "{}\t{}\twarn\t{}".format(file_name, line_number, text)
|
print(f"{file_name}\t{line_number}\twarn\t{text}")
|
||||||
print(output)
|
n += 1
|
||||||
|
if n:
|
||||||
|
print(f"{n} issue(s) found.", file=sys.stderr)
|
||||||
|
@@ -16,6 +16,7 @@ if __name__ == '__main__':
|
|||||||
# qt.shiboken: (<module>) <file>:<line>:[<column>:] text
|
# qt.shiboken: (<module>) <file>:<line>:[<column>:] text
|
||||||
# file might be c:\ on Windows
|
# file might be c:\ on Windows
|
||||||
pattern = re.compile(r'^qt\.shiboken: \(([^)]+)\) (..[^:]+):(\d+):(?:\d+:)? (.*)$')
|
pattern = re.compile(r'^qt\.shiboken: \(([^)]+)\) (..[^:]+):(\d+):(?:\d+:)? (.*)$')
|
||||||
|
n = 0
|
||||||
while True:
|
while True:
|
||||||
line = sys.stdin.readline()
|
line = sys.stdin.readline()
|
||||||
if not line:
|
if not line:
|
||||||
@@ -26,6 +27,7 @@ if __name__ == '__main__':
|
|||||||
file_name = match.group(2).replace('\\', '/')
|
file_name = match.group(2).replace('\\', '/')
|
||||||
line_number = match.group(3)
|
line_number = match.group(3)
|
||||||
text = match.group(4)
|
text = match.group(4)
|
||||||
output = "{}\t{}\twarn\t{}: {}".format(file_name, line_number,
|
print(f"{file_name}\t{line_number}\twarn\t{module}: {text}")
|
||||||
module, text)
|
n += 1
|
||||||
print(output)
|
if n:
|
||||||
|
print(f"{n} issue(s) found.", file=sys.stderr)
|
||||||
|
Reference in New Issue
Block a user