diff --git a/scripts/_helpers.py b/scripts/_helpers.py index 73b84eb..c872a00 100644 --- a/scripts/_helpers.py +++ b/scripts/_helpers.py @@ -10,8 +10,8 @@ def enable_mypy(approved_path: pathlib.Path) -> None: # Read the file text with line endings preserved lines = approved_path.read_text().splitlines(keepends=True) assert ( - lines[2] == "# type: ignore\n" - ), f"Expected third line to be '# type: ignore', got {lines[2]!r} in {approved_path}" + lines[2] == "# mypy: ignore-errors\n" + ), f"Expected third line to be '# mypy: ignore-errors', got {lines[2]!r} in {approved_path}" # Replace the third line with the updated mypy comment lines[2] = '# mypy: disable-error-code="no-any-return, no-untyped-call, misc, type-arg"\n' approved_path.write_text("".join(lines)) diff --git a/src/algokit_client_generator/generators/header_comments.py b/src/algokit_client_generator/generators/header_comments.py index 55fbd42..7196414 100644 --- a/src/algokit_client_generator/generators/header_comments.py +++ b/src/algokit_client_generator/generators/header_comments.py @@ -5,7 +5,8 @@ def disable_linting() -> DocumentParts: yield "# flake8: noqa" # this works for flake8 and ruff yield "# fmt: off" # disable formatting - yield "# type: ignore" # disable common type warnings + # https://mypy.readthedocs.io/en/stable/common_issues.html#ignoring-a-whole-file + yield "# mypy: ignore-errors" # ignore common mypy warnings def generate_header_comments(context: GeneratorContext) -> DocumentParts: