Add --result as legacy alias for --results argument#120
Merged
Conversation
- 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>
Copilot created this pull request from a session on behalf of
Malcolmnixon
April 13, 2026 19:34
View session
Contributor
There was a problem hiding this comment.
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
--resultas a fall-through alias for--resultsin CLI parsing. - Add two unit tests covering
--resultsuccess 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.
This was referenced Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Adds
--resultas an undocumented legacy alias for--resultsin 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: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-ResultAliasrequirement 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
Related Issues
Pre-Submission Checklist
Before submitting this pull request, ensure you have completed the following:
Build and Test
dotnet build --configuration Releasedotnet test --configuration Releasedotnet run --project src/DemaConsulting.SonarMark --configuration Release --framework net10.0--no-build -- --validateCode Quality
dotnet format --verify-no-changesLinting
./lint.sh(Unix/macOS) orcmd /c lint.bat/./lint.bat(Windows)Testing
Documentation
Additional Notes
--resultis a legacy compatibility alias only. It is not surfaced in--helpoutput, README, or user guide. New users should use--results.