Skip to content

Commit 83a3836

Browse files
authored
fix: correcting the ignore declaration for a more appropriate mypy global ignore (#41)
1 parent 7755be2 commit 83a3836

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

scripts/_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ def enable_mypy(approved_path: pathlib.Path) -> None:
1010
# Read the file text with line endings preserved
1111
lines = approved_path.read_text().splitlines(keepends=True)
1212
assert (
13-
lines[2] == "# type: ignore\n"
14-
), f"Expected third line to be '# type: ignore', got {lines[2]!r} in {approved_path}"
13+
lines[2] == "# mypy: ignore-errors\n"
14+
), f"Expected third line to be '# mypy: ignore-errors', got {lines[2]!r} in {approved_path}"
1515
# Replace the third line with the updated mypy comment
1616
lines[2] = '# mypy: disable-error-code="no-any-return, no-untyped-call, misc, type-arg"\n'
1717
approved_path.write_text("".join(lines))

src/algokit_client_generator/generators/header_comments.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
def disable_linting() -> DocumentParts:
66
yield "# flake8: noqa" # this works for flake8 and ruff
77
yield "# fmt: off" # disable formatting
8-
yield "# type: ignore" # disable common type warnings
8+
# https://mypy.readthedocs.io/en/stable/common_issues.html#ignoring-a-whole-file
9+
yield "# mypy: ignore-errors" # ignore common mypy warnings
910

1011

1112
def generate_header_comments(context: GeneratorContext) -> DocumentParts:

0 commit comments

Comments
 (0)