-
Notifications
You must be signed in to change notification settings - Fork 6
Add ty as a type checker #702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe PR integrates the Ty static type checker: adds Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (1)📚 Learning: 2025-12-10T17:13:08.136ZApplied to files:
🔇 Additional comments (4)
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 |
Deploying infrahub-sdk-python with
|
| Latest commit: |
8909db5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c80bac5e.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://pog-add-ty-typechecker.infrahub-sdk-python.pages.dev |
71b7c63 to
e19a174
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## stable #702 +/- ##
=======================================
Coverage 76.03% 76.03%
=======================================
Files 113 113
Lines 9743 9743
Branches 1490 1490
=======================================
Hits 7408 7408
Misses 1840 1840
Partials 495 495
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pyproject.toml (1)
125-179: Consider tracking the gradual enablement of ty rules.The ignored rules are clearly marked as temporary with comments indicating they "should be removed once the code has been updated." This is a reasonable gradual rollout strategy for adopting a new type checker.
To ensure these rules are systematically re-enabled, consider:
- Creating tracking issues for each category of ignored rules
- Adding a timeline or milestone for addressing them
- Periodically reviewing which rules can be enabled as code quality improves
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
.github/workflows/ci.yml(1 hunks)pyproject.toml(2 hunks)tasks.py(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Use type hints on all function signatures
Never mix async/sync inappropriately
Never bypass type checking without justification
Files:
tasks.py
🧠 Learnings (3)
📚 Learning: 2025-12-10T17:13:08.136Z
Learnt from: CR
Repo: opsmill/infrahub-sdk-python PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-10T17:13:08.136Z
Learning: Run `uv run invoke format lint` before committing Python code
Applied to files:
tasks.py.github/workflows/ci.yml
📚 Learning: 2025-12-10T17:13:08.136Z
Learnt from: CR
Repo: opsmill/infrahub-sdk-python PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-10T17:13:08.136Z
Learning: Run markdownlint before committing markdown changes
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-10T17:13:14.678Z
Learnt from: CR
Repo: opsmill/infrahub-sdk-python PR: 0
File: docs/AGENTS.md:0-0
Timestamp: 2025-12-10T17:13:14.678Z
Learning: Run `uv run invoke docs-validate` after making code changes to verify documentation is current
Applied to files:
.github/workflows/ci.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Cloudflare Pages
🔇 Additional comments (4)
tasks.py (1)
232-232: LGTM!Good placement of
lint_tyin the lint sequence. Running it before mypy allows both type checkers to provide independent feedback.pyproject.toml (2)
120-123: Verify the Python version target for ty.The ty configuration targets Python 3.10, while the project supports Python 3.10-3.14 and the CI runs on Python 3.12. Using the oldest supported version (3.10) for type checking is a reasonable conservative approach, but please confirm this is intentional.
85-85: The pinned versionty==0.0.4does not exist on PyPI. Verify the correct version and update the dependency—the latest available version is0.0.2. Also note that ty is still pre-release software; consider whether pinning to a pre-release version is appropriate for your project's stability requirements.Likely an incorrect or invalid review comment.
.github/workflows/ci.yml (1)
94-95: Thepython-version = "3.10"setting in[tool.ty.environment]defines the target Python version for type checking analysis, not the Python runtime version. This is intentional and correct—it ensures the code is type-checked against the minimum supported Python version (3.10) rather than the CI environment's Python 3.12. Since ty is a Rust-based tool that runs independently of the Python runtime, no mismatch or inconsistency exists.Likely an incorrect or invalid review comment.
tasks.py
Outdated
| @task | ||
| def lint_ty(context: Context) -> None: | ||
| """Run ty type checker against all Python files.""" | ||
| print(" - Check code with mypy") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| print(" - Check code with mypy") | |
| print(" - Check code with ty") |
e19a174 to
8909db5
Compare
Add ty as a type checker, and exclude current violations for each section of the code. Mypy will be removed in a follow up PR.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.