Skip to content

Enforce ty diagnostics#3588

Merged
koxudaxi merged 1 commit into
mainfrom
agent/enforce-ty-diagnostics
Jul 7, 2026
Merged

Enforce ty diagnostics#3588
koxudaxi merged 1 commit into
mainfrom
agent/enforce-ty-diagnostics

Conversation

@koxudaxi

@koxudaxi koxudaxi commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Tests
    • Expanded type-checking coverage to report two additional classes of issues during validation, helping catch more potential problems earlier.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates the tox.ini [testenv:type] environment to enable two additional ty check error categories—redundant-cast and possibly-missing-attribute—alongside the existing unused-ignore-comment check.

Changes

Tox Type-Check Configuration

Layer / File(s) Summary
Expand ty check error categories
tox.ini
Adds --error redundant-cast and --error possibly-missing-attribute to the ty check command in the [testenv:type] environment.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

  • koxudaxi/datamodel-code-generator#2928: Both PRs adjust the ty check setup in tox.ini (the main PR adding specific error categories, while the retrieved PR migrates the tox type-check command from pyright to ty).
  • koxudaxi/datamodel-code-generator#3547: Both PRs adjust the ty type-checking configuration in tox.ini to enforce stricter handling of # ty: ignore comments (main PR adds new error categories; retrieved PR gates “unused-ignore-comment”).

Suggested labels: breaking-change-analyzed

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title matches the main change: expanding ty diagnostics enforced in tox.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/enforce-ty-diagnostics

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📚 Docs Preview: https://pr-3588.datamodel-code-generator.pages.dev

@codspeed-hq

codspeed-hq Bot commented Jul 7, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 12.97%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 11 regressed benchmarks
✅ 2 untouched benchmarks
⏩ 98 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

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)

Open in CodSpeed

Footnotes

  1. 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: beee9ff0-5122-473c-8797-c47d19b550a9

📥 Commits

Reviewing files that changed from the base of the PR and between 171783e and 8859c43.

📒 Files selected for processing (1)
  • tox.ini

Comment thread tox.ini
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (171783e) to head (8859c43).

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           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@koxudaxi koxudaxi merged commit be80b48 into main Jul 7, 2026
60 of 61 checks passed
@koxudaxi koxudaxi deleted the agent/enforce-ty-diagnostics branch July 7, 2026 16:10
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Breaking Change Analysis

Result: 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

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🎉 Released in 0.68.1

This PR is now available in the latest release. See the release notes for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant