Skip to content

Make --lint also detect orphaned requirements when root tags are configured - #214

Merged
Malcolmnixon merged 3 commits into
mainfrom
fix/lint-includes-orphan-check
Sep 2, 2026
Merged

Make --lint also detect orphaned requirements when root tags are configured#214
Malcolmnixon merged 3 commits into
mainfrom
fix/lint-includes-orphan-check

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

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

  • --lint\ now also computes the merged root-tag set (YAML
    oot-tags:\ + CLI --root-tags) and calls \FindOrphans/\ReportOrphans\ when root tags are configured, reusing the exact same detection used by full requirements processing.
  • Non-fatal warning by default (matches --requirements\ behavior); --lint --enforce\ escalates orphans to a build-breaking error, matching --requirements --enforce.
  • No behavior change when no root tags are configured anywhere (fully backward compatible).
  • Updated --help\ text, README.md, and .github/standards/reqstream-usage.md\ to document the new combined behavior.

Testing

  • Added 4 new tests: --lint\ + root tags with orphans (warning), --lint --enforce\ + orphans (error), --lint\ + root tags with no orphans (no output), covering exit codes and message content.
  • \�uild.ps1: 1011 passed / 3 skipped (Unix-only), 0 failed.
  • \ ix.ps1/\lint.ps1: clean.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

…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>
Copilot AI lite review requested due to automatic review settings September 2, 2026 11:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 --lint when the merged root-tag set (YAML root-tags: + CLI --root-tags) is non-empty, emitting warnings by default and errors under --lint --enforce.
  • Add tests covering --lint orphan 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.

Comment thread README.md Outdated
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>
Copilot AI review requested due to automatic review settings September 2, 2026 12:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread README.md Outdated
Comment thread test/DemaConsulting.ReqStream.Tests/ProgramTests.cs
- 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>
Copilot AI review requested due to automatic review settings September 2, 2026 13:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 --lint orphan-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-tags provided with no YAML root-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

@Malcolmnixon
Malcolmnixon merged commit 5823162 into main Sep 2, 2026
16 checks passed
@Malcolmnixon
Malcolmnixon deleted the fix/lint-includes-orphan-check branch September 2, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants