Conversation
- Replace mypy with ty in Makefile, pyproject.toml, and dependencies - Fix list[Self] shadowing: use builtins.list[Self] in data modules where the list() classmethod shadows the builtin - Fix invalid-assignment in Client.user_profile (narrow type before assigning) - Fix dynamic function attribute in test_training_status (use dict) - Set invalid-method-override to warn (intentional Liskov violations in data subclass sorting wrappers) - Remove types-requests dependency (ty doesn't need stubs) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughSwap mypy for ty in linting/config, adjust Ruff options, standardize multiple data return annotations to Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #207 +/- ##
=======================================
Coverage 99.97% 99.97%
=======================================
Files 68 68
Lines 3547 3556 +9
=======================================
+ Hits 3546 3555 +9
Misses 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Add None guard for Response.request in telemetry hook (ty catches that PreparedRequest can be None, mypy didn't) - Only type-check src/ with ty (CI lint job doesn't have test deps) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pyproject.toml`:
- Around line 55-57: The ty config currently includes tests (tool.ty.src include
= ["src", "tests"]) but pytest is only in the testing dependency group, so
type-checking during the linting CI (which installs only --group linting) will
fail to resolve pytest imports; fix by either removing "tests" from tool.ty.src
so ty only checks src, or add pytest to the linting dependency group (move or
duplicate the pytest entry from the testing group into the linting group) so
imports resolve during lint CI. Ensure you update the pyproject.toml entry for
tool.ty.src or the dependency groups accordingly and keep the change consistent
with CI install flags.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 18a9abe2-b31e-4b14-af8a-c88e6b7c7ab1
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (15)
Makefilepyproject.tomlsrc/garth/data/_base.pysrc/garth/data/activity.pysrc/garth/data/body_battery/events.pysrc/garth/data/daily_sleep_data.pysrc/garth/data/fitness_stats.pysrc/garth/data/garmin_scores.pysrc/garth/data/hrv.pysrc/garth/data/morning_training_readiness.pysrc/garth/data/sleep.pysrc/garth/data/training_readiness.pysrc/garth/data/weight.pysrc/garth/http.pytests/stats/test_training_status.py
Never None for completed responses in practice. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Summary
Replace mypy with ty (from Astral, the ruff/uv team) for type checking.
Changes
list[Self]shadowing in data modules (builtins.list[Self])invalid-assignmentinClient.user_profileinvalid-method-overridetowarn(intentional Liskov violations in data sorting wrappers)types-requestsstub dependencyTest plan
uv run ty check— 0 errors, 10 warnings (all intentional)🤖 Generated with Claude Code
Summary by CodeRabbit