Skip to content

feat(checks): map MY family to ty and pyrefly config#818

Merged
henryiii merged 4 commits into
mainfrom
my-family-type-checkers
Jun 23, 2026
Merged

feat(checks): map MY family to ty and pyrefly config#818
henryiii merged 4 commits into
mainfrom
my-family-type-checkers

Conversation

@henryiii

@henryiii henryiii commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

Closes #813.

Previously MY100 only passed for tool.mypy, so projects using ty (or pyrefly) failed it even though PC140 already accepts all three type checkers.

Changes

  • MY100 "Uses a type checker (pyproject config)" — now passes for any of tool.mypy, tool.pyrefly, or tool.ty.
  • MY101 "Type checker in strict mode" — maps mypy's strict (bool) to pyrefly's preset (any value). ty has no strict switch, so this check is skipped when only ty is configured.
  • MY102–MY106 — these cover mypy-specific concepts (show_error_codes, warn_unreachable, and the enable_error_code entries) with no ty/pyrefly equivalent. They now skip (return None) when mypy is not configured, instead of failing. Since they require MY100 — which now passes for ty/pyrefly — skipping is what keeps them from failing on absent mypy keys.

Design note

Only MY100 and MY101 had genuine cross-tool mappings. ty tightens individual [tool.ty.rules] and pyrefly toggles [tool.pyrefly.errors], neither with a clean 1:1 to mypy's error codes — so rather than invent fuzzy mappings, the mypy-specific checks skip for non-mypy users. Happy to adjust if you'd prefer a different treatment.

Tests & docs

  • Added test coverage for MY100 (pyrefly/ty), MY101 (pyrefly preset present/absent, ty skipped), and MY102–106 skipping without mypy.
  • Regenerated the README check list (cog) and added {rr} cross-references in the style guide's pyrefly/ty tabs.

📚 Documentation preview 📚: https://scientific-python-cookie--818.org.readthedocs.build/

henryiii added 4 commits June 23, 2026 13:10
MY100 now passes for any of `tool.mypy`, `tool.pyrefly`, or `tool.ty`,
matching PC140. MY101 maps mypy's `strict` to pyrefly's `preset`. The
remaining MY checks cover mypy-only concepts with no ty/pyrefly
equivalent, so they skip (return None) when mypy is not configured
rather than failing.

Closes #813

Assisted-by: ClaudeCode:claude-opus-4.8
A stray VPP001 section crept in from running cog with a fuller venv;
the canonical list comes from the minimal `readme` session.

Assisted-by: ClaudeCode:claude-opus-4.8
Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@henryiii henryiii marked this pull request as ready for review June 23, 2026 17:37
@henryiii henryiii merged commit e084078 into main Jun 23, 2026
21 checks passed
@henryiii henryiii deleted the my-family-type-checkers branch June 23, 2026 17:49
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.

Disable MY100 if ty is being used

1 participant