Require @cli_doc marker for all CLI options#2712
Conversation
WalkthroughTest coverage validation for CLI documentation was refactored. The constant Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
tests/cli_doc/test_cli_doc_coverage.py (2)
49-61: Excellent refactoring to dynamic option discovery.The change from a hardcoded
DOCUMENTED_OPTIONSconstant to dynamically computing missing options is a significant improvement in maintainability. New CLI options will now be automatically validated without manual updates to a constant.However, the
# noqa: PLR6301directive is unnecessary since PLR6301 is not enabled.🔎 Remove unused noqa directive
- def test_all_options_have_cli_doc_markers( # noqa: PLR6301 + def test_all_options_have_cli_doc_markers( self, collected_options: set[str] ) -> None:Based on static analysis hints.
63-71: Good validation to ensure consistency.This test enforces a reasonable constraint: options with metadata in
CLI_OPTION_METAshould not be excluded from documentation viaMANUAL_DOCS. This helps maintain consistency in the documentation requirements.However, the
# noqa: PLR6301directive is unnecessary since PLR6301 is not enabled.🔎 Remove unused noqa directive
- def test_meta_options_not_manual(self) -> None: # noqa: PLR6301 + def test_meta_options_not_manual(self) -> None: """Verify that CLI_OPTION_META options are not in MANUAL_DOCS."""Based on static analysis hints.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/cli_doc/test_cli_doc_coverage.py(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/cli_doc/test_cli_doc_coverage.py (1)
src/datamodel_code_generator/cli_options.py (1)
get_all_canonical_options(269-271)
🪛 Ruff (0.14.8)
tests/cli_doc/test_cli_doc_coverage.py
49-49: Unused noqa directive (non-enabled: PLR6301)
Remove unused noqa directive
(RUF100)
63-63: Unused noqa directive (non-enabled: PLR6301)
Remove unused noqa directive
(RUF100)
⏰ 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). (11)
- GitHub Check: py312-black24 on Ubuntu
- GitHub Check: 3.13 on macOS
- GitHub Check: 3.10 on macOS
- GitHub Check: 3.10 on Windows
- GitHub Check: py312-pydantic1 on Ubuntu
- GitHub Check: 3.13 on Windows
- GitHub Check: 3.14 on Windows
- GitHub Check: 3.12 on Windows
- GitHub Check: 3.11 on Windows
- GitHub Check: benchmarks
- GitHub Check: Analyze (python)
🔇 Additional comments (1)
tests/cli_doc/test_cli_doc_coverage.py (1)
1-7: LGTM! Clear documentation.The updated docstring accurately reflects the purpose of the test module and clarifies the exception for MANUAL_DOCS.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2712 +/- ##
==========================================
- Coverage 99.34% 99.34% -0.01%
==========================================
Files 81 81
Lines 11535 11534 -1
Branches 1387 1387
==========================================
- Hits 11459 11458 -1
Misses 45 45
Partials 31 31
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:
|
CodSpeed Performance ReportMerging #2712 will not alter performanceComparing Summary
Footnotes
|
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.