Enforce ty diagnostics#3588
Conversation
📝 WalkthroughWalkthroughThis PR updates the ChangesTox Type-Check Configuration
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
📚 Docs Preview: https://pr-3588.datamodel-code-generator.pages.dev |
Merging this PR will degrade performance by 12.97%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | WallTime | test_perf_large_models_pydantic_v2 |
2.9 s | 3.5 s | -15.65% |
| ❌ | WallTime | test_perf_deep_nested |
4.3 s | 5 s | -14.69% |
| ❌ | WallTime | test_perf_all_options_enabled |
4.5 s | 5.3 s | -14.03% |
| ❌ | WallTime | test_perf_duplicate_names |
873 ms | 1,009.3 ms | -13.51% |
| ❌ | WallTime | test_perf_complex_refs |
1.7 s | 1.9 s | -13.3% |
| ❌ | WallTime | test_perf_openapi_large |
2.5 s | 2.9 s | -13.07% |
| ❌ | WallTime | test_perf_kubernetes_style_pydantic_v2 |
2.2 s | 2.5 s | -12.64% |
| ❌ | WallTime | test_perf_graphql_style_pydantic_v2 |
673.2 ms | 764.3 ms | -11.92% |
| ❌ | WallTime | test_perf_multiple_files_input |
2.9 s | 3.3 s | -11.91% |
| ❌ | WallTime | test_perf_aws_style_openapi_pydantic_v2 |
1.6 s | 1.8 s | -11.22% |
| ❌ | WallTime | test_perf_stripe_style_pydantic_v2 |
1.7 s | 1.9 s | -10.59% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing agent/enforce-ty-diagnostics (8859c43) with main (171783e)
Footnotes
-
98 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tox.ini`:
- Line 304: The type check config currently promotes possibly-missing-attribute
to an error in the ty invocation, but this flag is noisy in the pinned ty 0.0.9
release and can cause spurious tox failures. Update the ty check command in
tox.ini to keep possibly-missing-attribute as a warning or otherwise stop
treating it as a hard error until the type job is clean across supported Python
versions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3588 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 164 164
Lines 35243 35243
Branches 4063 4063
=========================================
Hits 35243 35243
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Breaking Change AnalysisResult: No breaking changes detected Reasoning: The only change is to tox.ini, adding stricter ty type-check flags (--error redundant-cast --error possibly-missing-attribute) to the internal [testenv:type] configuration. This is a development/CI-only change with no effect on generated code output, CLI options, the Python API, default behavior, supported Python versions, or error handling. Therefore it contains no user-facing breaking changes. This analysis was performed by Claude Code Action |
|
🎉 Released in 0.68.1 This PR is now available in the latest release. See the release notes for details. |
Summary by CodeRabbit