Skip to content

chore(type-check): switch static type checking from ty to pyrefly - #18

Merged
dlstadther merged 4 commits into
mainfrom
dlstadther/type-check
Sep 11, 2026
Merged

chore(type-check): switch static type checking from ty to pyrefly#18
dlstadther merged 4 commits into
mainfrom
dlstadther/type-check

Conversation

@dlstadther

@dlstadther dlstadther commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace ty with pyrefly as the project's static type checker across pyproject.toml, the pre-commit/prek config, Makefile, CI workflow, and README.md.
  • Local dev (make type, uv run prek run pyrefly-check) now matches the CI type-check job exactly.
  • Drop a stale # type: ignore comment that pyrefly doesn't need.
  • Use the official facebook/pyrefly-pre-commit hook (pyrefly-check, language: system) instead of a local hook, so the pre-commit run uses the project's own pinned pyrefly install.

Test plan

  • make format
  • make lint
  • make type (pyrefly, 0 errors)
  • make test
  • uv run prek run --all-files (all hooks, including pyrefly-check)
  • CI green on this PR

🤖 Generated with Claude Code

https://claude.ai/code/session_01K7kbQALeMCF5QWNrcyJj1r

dlstadther and others added 2 commits September 10, 2026 20:55
Replaces the ty dependency and config with pyrefly across
pyproject.toml, the pre-commit/prek hook, Makefile, CI workflow, and
README so local dev (`make type`, `uv run prek run pyrefly`) matches
CI exactly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7kbQALeMCF5QWNrcyJj1r
pyrefly reports zero errors on this line without a suppression
comment, so the leftover ty-era ignore is dead weight.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7kbQALeMCF5QWNrcyJj1r
Comment thread .pre-commit-config.yaml Outdated
dlstadther and others added 2 commits September 10, 2026 21:05
facebook/pyrefly-pre-commit exists (id pyrefly-check); the "no
official hook" note was a stale carryover from ty's pre-commit
comment and didn't apply to pyrefly. Use language: system so the
hook runs the project's own pyrefly install from pyproject.toml
instead of a separately pinned copy.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7kbQALeMCF5QWNrcyJj1r
1.3.0.dev4 is a pre-release build; pin to the latest stable tag
(1.2.0) instead. This only pins the hook script version — the
actual pyrefly version still comes from pyproject.toml via
language: system.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7kbQALeMCF5QWNrcyJj1r
@dlstadther
dlstadther merged commit c4b1678 into main Sep 11, 2026
5 checks passed
@dlstadther
dlstadther deleted the dlstadther/type-check branch September 11, 2026 01:18
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