Skip to content

Replace docstring with option_description in cli_doc marker#2839

Merged
koxudaxi merged 6 commits intomainfrom
feature/option-description-for-cli-doc
Dec 28, 2025
Merged

Replace docstring with option_description in cli_doc marker#2839
koxudaxi merged 6 commits intomainfrom
feature/option-description-for-cli-doc

Conversation

@koxudaxi
Copy link
Copy Markdown
Owner

No description provided.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 28, 2025

Warning

Rate limit exceeded

@koxudaxi has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 35 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 2cc9cee and 30a2ee9.

📒 Files selected for processing (16)
  • docs/cli-reference/base-options.md
  • docs/cli-reference/quick-reference.md
  • scripts/build_cli_docs.py
  • scripts/build_prompt_data.py
  • src/datamodel_code_generator/prompt_data.py
  • tests/conftest.py
  • tests/main/graphql/test_annotated.py
  • tests/main/graphql/test_main_graphql.py
  • tests/main/jsonschema/test_main_jsonschema.py
  • tests/main/openapi/test_main_openapi.py
  • tests/main/test_main_general.py
  • tests/main/test_main_json.py
  • tests/main/test_main_watch.py
  • tests/main/test_main_yaml.py
  • tests/test_input_model.py
  • tests/test_main_kr.py
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/option-description-for-cli-doc

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 and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 28, 2025

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

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Dec 28, 2025

CodSpeed Performance Report

Merging #2839 will degrade performance by 17.14%

Comparing feature/option-description-for-cli-doc (30a2ee9) with main (2cc9cee)

⚠️ 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.

Summary

❌ 11 regressions
⏩ 98 skipped1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Mode Benchmark BASE HEAD Efficiency
WallTime test_perf_large_models_pydantic_v2 3.1 s 3.7 s -16.8%
WallTime test_perf_duplicate_names 865.8 ms 1,028.8 ms -15.84%
WallTime test_perf_kubernetes_style_pydantic_v2 2.3 s 2.8 s -17.03%
WallTime test_perf_stripe_style_pydantic_v2 1.8 s 2.1 s -15.73%
WallTime test_perf_deep_nested 5.3 s 6.4 s -15.97%
WallTime test_perf_complex_refs 1.8 s 2.2 s -16.72%
WallTime test_perf_graphql_style_pydantic_v2 720 ms 858.1 ms -16.09%
WallTime test_perf_all_options_enabled 5.8 s 6.7 s -14.02%
WallTime test_perf_multiple_files_input 3.2 s 3.8 s -15.35%
WallTime test_perf_openapi_large 2.5 s 3 s -15.53%
WallTime test_perf_aws_style_openapi_pydantic_v2 1.7 s 2 s -17.14%

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.51%. Comparing base (fca31fe) to head (30a2ee9).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #2839    +/-   ##
========================================
  Coverage   99.51%   99.51%            
========================================
  Files          90       90            
  Lines       14100    14258   +158     
  Branches     1674     1697    +23     
========================================
+ Hits        14031    14189   +158     
  Misses         37       37            
  Partials       32       32            
Flag Coverage Δ
unittests 99.51% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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 ed67f88 into main Dec 28, 2025
37 of 38 checks passed
@koxudaxi koxudaxi deleted the feature/option-description-for-cli-doc branch December 28, 2025 15:48
@github-actions
Copy link
Copy Markdown
Contributor

Breaking Change Analysis

Result: No breaking changes detected

Reasoning: This PR changes the internal mechanism for how CLI documentation is generated from tests. Specifically, it replaces the use of test function docstrings with an explicit option_description parameter in the @pytest.mark.cli_doc marker.

Analysis of the changes:

  1. Code Generation Changes - No changes to generated code output. The changes only affect internal documentation generation tooling.

  2. Custom Template Update Required - No template changes required. This is purely a testing/documentation infrastructure change.

  3. API/CLI Changes - No changes to command-line options or public Python API. The OPTION_DESCRIPTIONS dict in prompt_data.py remains the same structure, just with a minor text change for one description (--input-model), which is an internal auto-generated file not part of the public API.

  4. Default Behavior Changes - No changes to default values or behavior of the code generator.

  5. Python Version Changes - No Python version changes.

  6. Error Handling Changes - No changes to error handling for end users.

The changes are entirely internal to the test infrastructure and documentation generation scripts:

  • tests/conftest.py - Added a new required parameter option_description to the cli_doc marker
  • scripts/build_cli_docs.py - Updated to read option_description instead of docstring
  • scripts/build_prompt_data.py - Updated to read option_description instead of docstring
  • Various test files - Added option_description to existing cli_doc markers

These are internal development tools and test markers, not part of the public API that end users interact with.


This analysis was performed by Claude Code Action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 1, 2026

🎉 Released in 0.51.0

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