Skip to content

Add CLI relationship summary#3530

Merged
koxudaxi merged 3 commits into
mainfrom
docs-option-relationship-summary
Jul 2, 2026
Merged

Add CLI relationship summary#3530
koxudaxi merged 3 commits into
mainfrom
docs-option-relationship-summary

Conversation

@koxudaxi

@koxudaxi koxudaxi commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Documentation

    • Added an Option Relationships section to the CLI reference, with a table linking options across implies, requires, and conflicts (including relevant conditions and value constraints).
    • Improved CLI docs regeneration to retain any previously auto-injected option example blocks instead of overwriting them.
  • Tests

    • Added tests to verify option relationship rendering (including omission when no metadata exists).
    • Added tests to confirm injected example blocks are preserved during doc regeneration.

@codspeed-hq

codspeed-hq Bot commented Jul 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

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

✅ 11 untouched benchmarks
⏩ 98 skipped benchmarks1


Comparing docs-option-relationship-summary (28faad0) with main (e6fc1d0)

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.

Comment thread scripts/build_cli_docs.py Fixed
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

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

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e86c60b5-c53d-4909-807e-afe6df5d58f9

📥 Commits

Reviewing files that changed from the base of the PR and between d7ba14f and 28faad0.

⛔ Files ignored due to path filters (1)
  • docs/llms-full.txt is excluded by none and included by none
📒 Files selected for processing (2)
  • scripts/build_cli_docs.py
  • tests/cli_doc/test_cli_options_sync.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/cli_doc/test_cli_options_sync.py
  • scripts/build_cli_docs.py

📝 Walkthrough

Walkthrough

This PR adds CLI reference generation for option relationships, preserves injected example sections in regenerated docs, and updates the generated index output and tests.

Changes

CLI docs generation

Layer / File(s) Summary
Relationship summary generation
scripts/build_cli_docs.py
Adds deterministic category ordering, relationship-table formatting helpers, and generate_relationship_summary(...) for option implies/requires/conflicts metadata.
Index and example preservation wiring
scripts/build_cli_docs.py, docs/cli-reference/index.md
Wires the relationship summary into the index build, preserves existing injected example blocks during write/check, and updates the generated CLI reference index with the new section.
CLI docs tests
tests/cli_doc/test_cli_options_sync.py
Adds coverage for example-block preservation and relationship-summary rendering/omission.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding a CLI relationship summary section to the docs.
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.
✨ 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 docs-option-relationship-summary

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.

@koxudaxi koxudaxi force-pushed the docs-option-relationship-summary branch from c59939b to 52122f3 Compare July 1, 2026 20:02

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

🧹 Nitpick comments (1)
tests/cli_doc/test_cli_options_sync.py (1)

420-458: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add coverage for "Conflicts" kind and multi-category ordering.

Both tests use a single category and only exercise "Implies"/"Requires". The "Conflicts" kind (rendered without a value suffix, per docs/cli-reference/index.md rows 39-40) and row ordering across multiple categories (via OPTION_CATEGORY_ORDER) are untested at the unit level.

🤖 Prompt for 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.

In `@tests/cli_doc/test_cli_options_sync.py` around lines 420 - 458, Add unit
coverage in test_cli_options_sync.py for generate_relationship_summary to verify
the “Conflicts” relationship rendering and that multiple categories are ordered
using OPTION_CATEGORY_ORDER. Update or add tests around CLIDocOption and
build_cli_docs.generate_relationship_summary so one case asserts a Conflicts row
is emitted without a value suffix, and another uses options from more than one
OptionCategory to confirm the final summary preserves the expected category
ordering.
🤖 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.

Nitpick comments:
In `@tests/cli_doc/test_cli_options_sync.py`:
- Around line 420-458: Add unit coverage in test_cli_options_sync.py for
generate_relationship_summary to verify the “Conflicts” relationship rendering
and that multiple categories are ordered using OPTION_CATEGORY_ORDER. Update or
add tests around CLIDocOption and build_cli_docs.generate_relationship_summary
so one case asserts a Conflicts row is emitted without a value suffix, and
another uses options from more than one OptionCategory to confirm the final
summary preserves the expected category ordering.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 215a3e17-8db9-4a1b-93c5-dd538eb369c8

📥 Commits

Reviewing files that changed from the base of the PR and between 0f09aee and 52122f3.

📒 Files selected for processing (3)
  • docs/cli-reference/index.md
  • scripts/build_cli_docs.py
  • tests/cli_doc/test_cli_options_sync.py

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e6fc1d0) to head (28faad0).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #3530   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          159       159           
  Lines        34268     34268           
  Branches      4001      4001           
=========================================
  Hits         34268     34268           
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 added 2 commits July 2, 2026 11:45
…hip-summary

# Conflicts:
#	docs/cli-reference/index.md
#	scripts/build_cli_docs.py
…hip-summary

# Conflicts:
#	docs/llms-full.txt
@koxudaxi koxudaxi merged commit cab75a2 into main Jul 2, 2026
61 checks passed
@koxudaxi koxudaxi deleted the docs-option-relationship-summary branch July 2, 2026 03:08
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Breaking Change Analysis

Result: No breaking changes detected

Reasoning: The PR only modifies documentation files (docs/cli-reference/index.md, docs/llms-full.txt) and a documentation-generation helper script (scripts/build_cli_docs.py) plus its tests (tests/cli_doc/test_cli_options_sync.py). All changes are additive doc content (Option Relationships table, Input Format Guide, Scenario Guide, richer generated examples) and new internal helper functions/tests in the docs tooling. No CLI option, Python API, enum value, class, default value, or generated-code behavior of datamodel-code-generator was changed. The deleted lines are only documentation placeholder text and hard-coded example timestamps, not runtime behavior. None of the six breaking-change categories apply.


This analysis was performed by Claude Code Action

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🎉 Released in 0.67.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.

2 participants