Skip to content

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

Merged
Malcolmnixon merged 1 commit into
mainfrom
copilot/add-result-command-alias
Apr 13, 2026
Merged

Add --result as legacy alias for --results argument#120
Malcolmnixon merged 1 commit into
mainfrom
copilot/add-result-command-alias

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 13, 2026

Pull Request

Description

Adds --result as an undocumented legacy alias for --results in CLI argument parsing. The alias is intentionally omitted from --help, README, and user guide — existing users who depend on the old form continue to work without new users being directed to it.

CLI (Context.cs) — fall-through case:

case "--result":   // Legacy alias — not in help text
case "--results":
    ...

Design (context.md) — new "Backward Compatibility" section documents the alias, its rationale, and its deliberate exclusion from user-facing docs.

Requirements (context.yaml)SonarMark-Context-ResultAlias requirement added with traceability links to both new tests.

Tests (ContextTests.cs) — two new unit tests covering the happy path and the missing-filename error case for --result.

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.SonarMark --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

Linting

  • 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 a legacy compatibility alias only. It is not surfaced in --help output, README, or user guide. New users should use --results.

- Add case "--result" fall-through in ArgumentParser switch to alias --results
- Add Context_Create_ResultAlias_SetsResultsProperty test
- Add Context_Create_MissingResultAliasFilename_ThrowsException test
- Add SonarMark-Context-ResultAlias requirement to context.yaml
- Document backward compatibility in context.md design doc

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
@Malcolmnixon Malcolmnixon marked this pull request as ready for review April 13, 2026 19:34
Copilot AI review requested due to automatic review settings April 13, 2026 19:34
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, undocumented CLI alias so existing automation using --result continues to work while keeping --results as the documented flag.

Changes:

  • Accept --result as a fall-through alias for --results in CLI parsing.
  • Add two unit tests covering --result success and missing-filename error behavior.
  • Document the compatibility behavior in design docs and add a traced requirement entry.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/DemaConsulting.SonarMark/Cli/Context.cs Adds --result switch case falling through to existing --results handling.
test/DemaConsulting.SonarMark.Tests/Cli/ContextTests.cs Adds coverage for --result parsing and error messaging.
docs/reqstream/sonar-mark/cli/context.yaml Introduces a requirement documenting the legacy alias and links it to the new tests.
docs/design/sonar-mark/cli/context.md Documents the backward-compatibility rationale and implementation approach.

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

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