Skip to content

fix: ignore type errors in copied files without mutants#523

Merged
nicklafleur merged 1 commit into
boxed:mainfrom
skyswordw:fix-unowned-type-check-errors
Jun 10, 2026
Merged

fix: ignore type errors in copied files without mutants#523
nicklafleur merged 1 commit into
boxed:mainfrom
skyswordw:fix-unowned-type-check-errors

Conversation

@skyswordw

Copy link
Copy Markdown
Contributor

Summary

Fixes a type_check_command crash when a type checker reports an error in a copied file that contains no generated mutmut mutant functions.

The type-check filtering step still raises for unowned errors in files that do contain generated mutants, because those remain ambiguous and may indicate a mutation affected code outside the mutant function body.

Closes #522.

Testing

  • uv run pytest tests/test_type_checking.py
  • uv run pytest tests/test_type_checking.py tests/e2e/test_e2e_type_checking.py
  • uv run ruff check .
  • uv run ruff format --check .
  • uv run pytest -k 'not test_setproctitle_crashes_after_fork_with_corefoundation_loaded' -> 299 passed, 2 skipped, 1 deselected

Notes:

  • uv run pytest reported 299 passed, 2 skipped, 1 failed; the failure was the existing macOS sentinel tests/utils/test_safe_setproctitle.py::test_setproctitle_crashes_after_fork_with_corefoundation_loaded, unrelated to type-check filtering.
  • uv run pre-commit run --all-files was attempted but hung during hook environment bootstrap in git submodule update --init --recursive --depth=1, before running project checks.

@nicklafleur

Copy link
Copy Markdown
Collaborator

@skyswordw thanks for contributing a detailed issue and opening this draft. I've enabled test runs for you to help, feel free to request a review from me when the branch is ready.

@skyswordw skyswordw marked this pull request as ready for review June 10, 2026 02:12
@skyswordw

skyswordw commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for enabling the test runs. The PR is ready now, and the Python 3.10-3.14 jobs are all green.

@nicklafleur nicklafleur left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 🚀

@nicklafleur nicklafleur merged commit 5b8721f into boxed:main Jun 10, 2026
5 checks passed
@skyswordw

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing and merging it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

type_check_command: "Could not find mutant for type error" crash when the pyrefly reports an error outside any mutant's line range

2 participants