Make --lint also detect orphaned requirements when root tags are configured - #214
Conversation
…igured Previously --lint only checked structural/schema issues (duplicate ids, malformed YAML, etc.) via LoadResult.Issues, bypassing orphan detection entirely. Agents running --lint expected to see orphan-shaped requirements alongside other lint issues in a single invocation. --lint now also computes the merged root-tag set and runs FindOrphans when root tags are configured, reporting orphans as a non-fatal warning by default, or as an error (failing the run) when combined with --enforce - matching the existing warning/error convention used by full requirements processing. No behavior change when root tags are not configured. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
Core behavior change is consistent with existing orphan-detection logic and is covered by targeted tests, with only a minor README help-output consistency nit noted.
Pull request overview
This PR extends ReqStream’s --lint mode to also perform orphaned-requirement detection when root tags are configured, aligning lint behavior with full requirements processing and documenting the combined behavior.
Changes:
- Run orphan detection during
--lintwhen the merged root-tag set (YAMLroot-tags:+ CLI--root-tags) is non-empty, emitting warnings by default and errors under--lint --enforce. - Add tests covering
--lintorphan reporting (warning/error) and the no-orphans case. - Update CLI help text and documentation to describe the new
--lint+ orphan-detection behavior.
File summaries
| File | Description |
|---|---|
src/DemaConsulting.ReqStream/Program.cs |
Adds orphan detection/reporting to the --lint execution path and updates --help text. |
test/DemaConsulting.ReqStream.Tests/ProgramTests.cs |
Adds test coverage for orphan reporting behavior under --lint (warning vs --enforce error) and for no-orphan output. |
README.md |
Documents that --lint includes orphan detection when root tags are configured (help/options section and orphan-checking guidance). |
.github/standards/reqstream-usage.md |
Updates standards guidance to state orphan detection runs with --lint as well as full requirements processing, including --lint --enforce semantics. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Address PR #214 review comment: the README's help-output example still said 'structural issues' with mismatched spacing, but Program.PrintHelp actually emits 'Lint requirements files for issues'. Corrected wording and column alignment so the documented example matches real --help output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The README --help output example is still out of sync with Program.PrintHelp option ordering, so the documentation update is not fully correct.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Lite
- Trim the --lint description to a concise phrase ('...for issues
(including orphans)') instead of a full sentence, matching the
short style of other CLI option descriptions.
- Reorder README's --help example so --lint appears before --log,
matching Program.PrintHelp's actual emission order.
- Clarify the ProgramTests doc-comment: --lint still requires
--requirements to specify input files; what it avoids is a
separate full requirements-processing invocation (--report/--matrix).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The code changes match existing orphan-detection behavior, are covered by new tests, and documentation/help text are updated accordingly.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
test/DemaConsulting.ReqStream.Tests/ProgramTests.cs:1188
- The PR description claims 4 new tests were added for the new
--lintorphan-detection behavior, but the code changes only introduce 3 new[Fact]tests in this file. Either update the PR description or add the missing test case (for example: CLI--root-tagsprovided with no YAMLroot-tags:) so the documentation of testing matches what was actually added.
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
- Review effort level: Lite
Problem
--lint only performed structural/schema-level checks (duplicate ids, malformed YAML, etc.) and never ran orphan detection, even when root tags (
oot-tags:/--root-tags) were configured. Agents running --lint\ expected to see orphan-shaped requirements reported alongside other lint issues, since orphan-detection is conceptually a structural lint concern (a requirement that doesn't trace to anything real is just as much a shape problem as a duplicate id).
Fix
oot-tags:\ + CLI --root-tags) and calls \FindOrphans/\ReportOrphans\ when root tags are configured, reusing the exact same detection used by full requirements processing.
Testing
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com