Skip to content

docs: add pyrefly tabs alongside mypy in type-checking guide#816

Merged
henryiii merged 2 commits into
mainfrom
docs/pyrefly-tabs
Jun 23, 2026
Merged

docs: add pyrefly tabs alongside mypy in type-checking guide#816
henryiii merged 2 commits into
mainfrom
docs/pyrefly-tabs

Conversation

@henryiii

@henryiii henryiii commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

Adds Pyrefly as a tabbed alternative to MyPy in the Type checking section of docs/guides/style.md, using the existing mystmd tab-set/tab-item convention with :sync: so the checker choice stays consistent across snippets.

What changed

  • Intro prose — notes Pyrefly as a fast Rust-based checker shown alongside MyPy.
  • Pre-commit hook — tab-set with the existing MyPy hook and a new Pyrefly tab (facebook/pyrefly-pre-commit, id: pyrefly-check).
  • pyproject.toml config — tab-set keeping the full MyPy config (incl. {rr} repo-review codes) and a new Pyrefly tab.

Pyrefly equivalents used

MyPy Pyrefly
files = "src" project-includes = ["src"]
python_version python-version
strict = true preset = "strict"
[[tool.mypy.overrides]] + ignore_missing_imports ignore-missing-imports = ["numpy"]
per-code toggles [tool.pyrefly.errors] table
# type: ignore # pyrefly: ignore (also honors # type: ignore)

Notes

  • docs/guides/mypy.md left untouched — it's a conceptual typing deep-dive (MyPy as the running example), with no tool config that maps to a Pyrefly variant.
  • Pyrefly moves fast; the hook is pinned to rev: "1.1.1". Worth confirming the version against repo conventions.
  • Verified the page builds cleanly with myst build --html (no warnings).

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

Show Pyrefly as a tabbed alternative to MyPy in the Type checking section,
covering the pre-commit hook and the pyproject.toml configuration. Tabs use
`:sync:` so the checker choice stays consistent across both snippets.

Assisted-by: ClaudeCode:claude-opus-4.8
Comment thread docs/guides/style.md Outdated
@henryiii henryiii marked this pull request as ready for review June 23, 2026 15:38
@henryiii henryiii merged commit 308c442 into main Jun 23, 2026
7 checks passed
@henryiii henryiii deleted the docs/pyrefly-tabs branch June 23, 2026 16:04
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.

1 participant