Skip to content

Commit

Permalink
fix: correcting the ignore declaration for a more appropriate mypy gl…
Browse files Browse the repository at this point in the history
…obal ignore (#41)
  • Loading branch information
aorumbayev authored Feb 11, 2025
1 parent 7755be2 commit 83a3836
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
3 changes: 2 additions & 1 deletion src/algokit_client_generator/generators/header_comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

1 comment on commit 83a3836

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/algokit_client_generator
   __main__.py220%1–3
   cli.py48480%1–87
   document.py82791%44, 47, 49–50, 55, 74–75
   generator.py31197%23
   spec.py2071692%86, 116–119, 219–223, 253, 269, 350–351, 395, 410
   utils.py2194878%11, 20, 24, 28, 32, 36, 40, 44, 55, 58, 63–64, 75–76, 82–84, 89–91, 94–96, 99, 102, 105, 108–110, 159–160, 194, 198, 201–202, 218, 220, 231–232, 249, 261–264, 268, 278, 281, 283
src/algokit_client_generator/generators
   composer.py51198%29
   typed_client.py328898%59, 188, 287, 590, 680, 690, 729, 840
   typed_factory.py213399%64, 94, 227
TOTAL125213489% 

Tests Skipped Failures Errors Time
42 0 💤 0 ❌ 0 🔥 19.611s ⏱️

Please sign in to comment.