Skip to content

Add --result as legacy alias for --results argument#97

Merged
Malcolmnixon merged 2 commits intomainfrom
copilot/add-results-alias-support
Apr 13, 2026
Merged

Add --result as legacy alias for --results argument#97
Malcolmnixon merged 2 commits intomainfrom
copilot/add-results-alias-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 13, 2026

Pull Request

Description

Adds --result as a backwards-compatible legacy alias for --results. The alias is intentionally undocumented in the README and user guide — captured only in design docs and requirements for traceability.

Changes:

  • CLI (Context.cs): Switch fallthrough case "--result":case "--results": with a comment marking it as a legacy alias
  • Tests (CliTests.cs): Added Cli_ResultLegacyAlias_SetsResultsFilePath subsystem test
  • Tests (ContextTests.cs): Added Context_Create_ResultLegacyAlias_SetsResultsFile unit test for direct parsing coverage
  • Design docs (docs/design/sarifmark/cli/context.md): --result documented as legacy alias in a note below the properties table; table formatting fixed for lint compliance
  • Requirements (docs/reqstream/sarifmark/cli/cli.yaml, context.yaml): Added SarifMark-Cli-ResultLegacyAlias and SarifMark-Context-ResultLegacyAlias requirements with proper traceability linkage to their respective test levels; requirement title shortened for lint compliance

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code quality improvement

Related Issues

Pre-Submission Checklist

Before submitting this pull request, ensure you have completed the following:

Build and Test

  • Code builds successfully: dotnet build --configuration Release
  • All unit tests pass: dotnet test --configuration Release
  • Self-validation tests pass:
    dotnet run --project src/DemaConsulting.SarifMark --configuration Release --framework net10.0
    --no-build -- --validate
  • Code produces zero warnings

Code Quality

  • Code formatting is correct: dotnet format --verify-no-changes
  • New code has appropriate XML documentation comments
  • Static analyzer warnings have been addressed

Quality Checks

Please run the following checks before submitting:

  • All linters pass: ./lint.sh (Unix/macOS) or cmd /c lint.bat / ./lint.bat (Windows)

Testing

  • Added unit tests for new functionality
  • Updated existing tests if behavior changed
  • All tests follow the AAA (Arrange, Act, Assert) pattern
  • Test coverage is maintained or improved

Documentation

  • Updated README.md (if applicable)
  • Updated ARCHITECTURE.md (if applicable)
  • Added code examples for new features (if applicable)
  • Updated requirements.yaml (if applicable)

Additional Notes

--result is deliberately absent from the README and user guide. New users should use --results; --result exists solely for backwards compatibility and is tracked only in design documentation and requirements traceability.

The SarifMark-Context-ResultLegacyAlias requirement in context.yaml links to the Context_Create_* unit test (matching the hierarchy for all other context-level requirements), while SarifMark-Cli-ResultLegacyAlias in cli.yaml links to the Cli_* subsystem test.

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
@Malcolmnixon Malcolmnixon marked this pull request as ready for review April 13, 2026 19:23
Copilot AI review requested due to automatic review settings April 13, 2026 19:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a backward-compatible --result CLI flag as a legacy alias for --results, with traceability captured in design docs and ReqStream requirements.

Changes:

  • Added --result fallthrough handling to the CLI argument parser (Context.ParseArgument).
  • Added a CLI subsystem test verifying --result sets ResultsFile.
  • Updated design and ReqStream docs/requirements to capture the legacy alias and its traceability.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/DemaConsulting.SarifMark.Tests/Cli/CliTests.cs Adds subsystem test coverage for the legacy --result alias.
src/DemaConsulting.SarifMark/Cli/Context.cs Implements --result as a fallthrough alias to --results.
docs/reqstream/sarifmark/cli/context.yaml Adds Context-level requirement for the alias (but currently links to a Cli_* test).
docs/reqstream/sarifmark/cli/cli.yaml Adds CLI-level requirement for accepting --result.
docs/design/sarifmark/cli/context.md Documents --result as a legacy alias in the design argument/property table.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/reqstream/sarifmark/cli/context.yaml Outdated
Comment thread src/DemaConsulting.SarifMark/Cli/Context.cs
@Malcolmnixon
Copy link
Copy Markdown
Member

@copilot Please fix issues reported by linting.

…tsFile unit test

Agent-Logs-Url: https://github.com/demaconsulting/SarifMark/sessions/ab80a80d-fa69-4288-a36c-9f2040dcf4b1

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 13, 2026

@copilot Please fix issues reported by linting.

Fixed in commit 50ed83e:

  • Shortened the requirement title in context.yaml to fix the line-too-long YAML lint error
  • Updated the context.yaml requirement to reference Context_Create_ResultLegacyAlias_SetsResultsFile (unit test) instead of Cli_ResultLegacyAlias_SetsResultsFilePath (subsystem test), per the review comment
  • Added the Context_Create_ResultLegacyAlias_SetsResultsFile unit test to ContextTests.cs
  • Fixed the context.md table row for ResultsFile to match header column widths (moved the legacy alias note to a separate paragraph below the table), resolving the line-length and table-alignment lint errors

Copilot AI requested a review from Malcolmnixon April 13, 2026 19:44
@Malcolmnixon Malcolmnixon merged commit 49878e5 into main Apr 13, 2026
16 checks passed
@Malcolmnixon Malcolmnixon deleted the copilot/add-results-alias-support branch April 13, 2026 20:05
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.

3 participants