Skip to content

Commit 8ecc458

Browse files
Remove unnecessary flags from --check test (#2708)
* Remove unnecessary flags from --check test * docs: update CLI reference documentation 🤖 Generated by GitHub Actions --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 66769b1 commit 8ecc458

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

docs/cli-reference/general-options.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,14 +1168,12 @@ The `--check` flag compares the generated output with existing files and exits w
11681168
a non-zero status if they differ. Useful for CI/CD validation to ensure schemas
11691169
and generated code stay in sync. Works with both single files and directory outputs.
11701170

1171-
**Related:** [`--no-use-standard-collections`](typing-customization.md#no-use-standard-collections), [`--no-use-union-operator`](typing-customization.md#no-use-union-operator)
1172-
11731171
**See also:** [CI/CD Integration](../ci-cd.md)
11741172

11751173
!!! tip "Usage"
11761174

11771175
```bash
1178-
datamodel-codegen --input schema.json --disable-timestamp --use-union-operator --use-standard-collections --check # (1)!
1176+
datamodel-codegen --input schema.json --disable-timestamp --check # (1)!
11791177
```
11801178

11811179
1. :material-arrow-left: `--check` - the option documented here

tests/main/test_main_general.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,8 @@ def test_skip_root_model_command_line(output_file: Path) -> None:
473473
@pytest.mark.cli_doc(
474474
options=["--check"],
475475
input_schema="jsonschema/person.json",
476-
cli_args=["--disable-timestamp", "--use-union-operator", "--use-standard-collections", "--check"],
476+
cli_args=["--disable-timestamp", "--check"],
477477
golden_output="person.py",
478-
related_options=["--use-union-operator", "--use-standard-collections"],
479478
)
480479
def test_check_file_matches(output_file: Path) -> None:
481480
"""Verify generated code matches existing output without modifying files.
@@ -489,13 +488,13 @@ def test_check_file_matches(output_file: Path) -> None:
489488
input_path=input_path,
490489
output_path=output_file,
491490
input_file_type="jsonschema",
492-
extra_args=["--disable-timestamp", "--use-union-operator", "--use-standard-collections"],
491+
extra_args=["--disable-timestamp"],
493492
)
494493
run_main_and_assert(
495494
input_path=input_path,
496495
output_path=output_file,
497496
input_file_type="jsonschema",
498-
extra_args=["--disable-timestamp", "--use-union-operator", "--use-standard-collections", "--check"],
497+
extra_args=["--disable-timestamp", "--check"],
499498
expected_exit=Exit.OK,
500499
)
501500

0 commit comments

Comments
 (0)