Skip to content

Commit 2547528

Browse files
theletterfclaude
andcommitted
Address review feedback on list-dependents
- Tag the usage code fence as bash so it satisfies markdownlint MD040. - Reject unsupported --format values explicitly with a guard clause rather than silently falling back to JSON, so typos in CI or local use surface as errors. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2ed6e89 commit 2547528

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

docs/cli/docset/list-dependents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ that would re-render, so the comment can point at them instead.
1313

1414
## Usage
1515

16-
```
16+
```bash
1717
docs-builder list-dependents --files <paths> [options...] [-h|--help] [--version]
1818
```
1919

src/authoring/Elastic.Documentation.Refactor/Tracking/ListDependentsService.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ public async Task<bool> ListDependents(
3737
return false;
3838
}
3939

40+
if (!format.Equals("json", StringComparison.OrdinalIgnoreCase) &&
41+
!format.Equals("text", StringComparison.OrdinalIgnoreCase))
42+
{
43+
collector.EmitGlobalError($"Unsupported format '{format}'. Expected 'json' or 'text'.");
44+
return false;
45+
}
46+
4047
var context = new BuildContext(collector, fs, fs, configurationContext, ExportOptions.MetadataOnly, path, null);
4148
var set = new DocumentationSet(context, logFactory, NoopCrossLinkResolver.Instance);
4249

0 commit comments

Comments
 (0)