chore(type-check): switch static type checking from ty to pyrefly - #18
Merged
Conversation
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
dlstadther
commented
Sep 11, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tywith pyrefly as the project's static type checker acrosspyproject.toml, the pre-commit/prek config,Makefile, CI workflow, andREADME.md.make type,uv run prek run pyrefly-check) now matches the CItype-checkjob exactly.# type: ignorecomment that pyrefly doesn't need.facebook/pyrefly-pre-commithook (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 formatmake lintmake type(pyrefly, 0 errors)make testuv run prek run --all-files(all hooks, includingpyrefly-check)🤖 Generated with Claude Code
https://claude.ai/code/session_01K7kbQALeMCF5QWNrcyJj1r