summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-12-03 17:07:08 +0100
committerFlorian Bruhin <me@the-compiler.org>2020-12-03 17:07:08 +0100
commit6e40605ae16b820160dc8ad1386d64055146c067 (patch)
tree89536a3b711781ce69c238af3cb9c6b9fa27902f
parent83286f94564e7c191231ef073e71d1186957b15c (diff)
downloadqutebrowser-6e40605ae16b820160dc8ad1386d64055146c067.tar.gz
qutebrowser-6e40605ae16b820160dc8ad1386d64055146c067.zip
scripts: Improve output for misc_checks
- Don't output type annotation message for "# type: ignore" - Output entire message colored - Strip colors in problemmatcher regex
-rw-r--r--scripts/dev/ci/problemmatchers.py2
-rw-r--r--scripts/dev/misc_checks.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/scripts/dev/ci/problemmatchers.py b/scripts/dev/ci/problemmatchers.py
index 3e804af05..083945051 100644
--- a/scripts/dev/ci/problemmatchers.py
+++ b/scripts/dev/ci/problemmatchers.py
@@ -188,7 +188,7 @@ MATCHERS = {
"severity": "error",
"pattern": [
{
- "regexp": r'^([^:]+):(\d+): (Found .*)',
+ "regexp": r'^([^:]+):(\d+): \033[34m(Found .*)\033[0m',
"file": 1,
"line": 2,
"message": 3,
diff --git a/scripts/dev/misc_checks.py b/scripts/dev/misc_checks.py
index 7b9ce769b..ad446412c 100644
--- a/scripts/dev/misc_checks.py
+++ b/scripts/dev/misc_checks.py
@@ -145,8 +145,8 @@ def _check_spelling_file(path, fobj, patterns):
for pattern, explanation in patterns:
if pattern.search(line):
ok = False
- print(f'{path}:{num}: Found "{pattern.pattern}" - ', end='')
- utils.print_col(explanation, 'blue')
+ print(f'{path}:{num}: ', end='')
+ utils.print_col(f'Found "{pattern.pattern}" - {explanation}', 'blue')
return ok
@@ -185,7 +185,7 @@ def check_spelling(args: argparse.Namespace) -> Optional[bool]:
"'type: ignore[error-code]' instead."),
),
(
- re.compile(r'# type: (?!ignore\[)'),
+ re.compile(r'# type: (?!ignore(\[|$))'),
"Don't use type comments, use type annotations instead.",
),
(