[codex] Use Pyrefly for type checking#46
Conversation
|
Warning Review limit reached
More reviews will be available in 37 minutes and 4 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR migrates the project’s static type checking workflow from mypy to Pyrefly, aligning local tooling (scripts and pre-commit) and CI to run pyrefly check under Python 3.14, and includes small code adjustments to satisfy Pyrefly’s type diagnostics without changing scraper behavior.
Changes:
- Replaced mypy with
pyrefly>=1.1.1in dev dependencies and updateduv.lockaccordingly. - Added strict Pyrefly configuration in
pyproject.tomland routedscripts/typecheck.sh, pre-commit, and CI to use Pyrefly (with GitHub annotation output in CI). - Addressed type-checking issues via small, behavior-preserving typing/narrowing tweaks in a few modules.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Swaps mypy-related locked dependencies for Pyrefly and adds the Pyrefly lock entry. |
| src/gmaps_scraper/translation_memory.py | Adds explicit runtime narrowing and typing for JSON-ish payload fields to satisfy stricter checking. |
| src/gmaps_scraper/place_scraper.py | Removes a redundant str(...) cast while preserving the existing isinstance(value, str) filter. |
| src/gmaps_scraper/display_fields.py | Adds an explicit list[str] annotation to keep diagnostics typing strict. |
| scripts/typecheck.sh | Routes type checking through uv run pyrefly check, emitting GitHub-formatted annotations in Actions. |
| pyproject.toml | Replaces [tool.mypy] with a strict [tool.pyrefly] configuration and updates dev deps. |
| .pre-commit-config.yaml | Renames the local typecheck hook to Pyrefly while continuing to invoke ./scripts/typecheck.sh. |
| .github/workflows/ci.yml | Renames the typecheck step to reflect Pyrefly (command remains ./scripts/typecheck.sh). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 335563dee6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| preset = "strict" | ||
| check-unannotated-defs = true |
There was a problem hiding this comment.
Preserve strict annotation checks
When a new src function has annotated parameters but omits -> ..., this config no longer fails the typecheck gate: Pyrefly documents unannotated-return as default ignore, and check-unannotated-defs only checks function bodies, while the removed mypy strict = true enabled --disallow-untyped-defs/--disallow-incomplete-defs. Add the equivalent Pyrefly error overrides, e.g. for missing return annotations, if the previous strict typed-API gate is meant to be preserved.
Useful? React with 👍 / 👎.
Summary
uv.lock.srcpackage on Python 3.14.pyrefly check, including GitHub annotation output in CI.Validation
./scripts/check-all.shuv run pyrefly check --min-severity warn --summarize-errorsuv lock --check