Skip to content

Apply TemplateDotNetTool template consistency updates to SonarMark#98

Merged
Malcolmnixon merged 6 commits intomainfrom
copilot/update-template-project
Mar 4, 2026
Merged

Apply TemplateDotNetTool template consistency updates to SonarMark#98
Malcolmnixon merged 6 commits intomainfrom
copilot/update-template-project

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

Syncs SonarMark with recent TemplateDotNetTool template improvements across code correctness, project configuration, CI workflows, agent documentation, self-validation output, and requirements.

Code fixes (Program.cs, Context.cs)

  • Error messages in Main() catch blocks now route to Console.Error.WriteLine (stderr)
  • Version output uses context.WriteLine() — respects --silent and log file routing
  • WriteError() writes to Console.Error.WriteLine (stderr)
  • Log StreamWriter gains AutoFlush = true for immediate disk writes on unexpected termination
  • 3 tests updated to capture Console.Error instead of Console.Out

Self-validation output (Validation.cs, template PR #51)

  • Console output now shows test names (SonarMark_QualityGateRetrieval - Passed) instead of descriptions (Quality Gate Retrieval Test - PASSED)
  • Status uses title case: Passed/Failed (consistent with template)
  • Removed unused displayName parameter from RunValidationTest

Project configuration

  • Tests.csproj: LangVersion 12latest
  • SonarMark.csproj: package ItemGroups split into labeled sections — Runtime Dependencies, Build Tool Dependencies, Code Analysis Dependencies; Polyfill moved to build tools with simple PrivateAssets="All"

CI workflow (build.yaml)

  • CodeQL job: adds missing dotnet tool restore before dotnet restore
  • build-docs job: adds sonarmark to versionmark --capture tool list

Requirements (requirements.yaml, template PR #50)

  • Applied semantic requirement IDs with SonarMark- prefix throughout: e.g. CLI-001SonarMark-Cmd-Cli, PLT-001SonarMark-Plt-Windows, SONAR-003SonarMark-Svr-QualityGate
  • Category abbreviations: ServerSvr, ReportRpt, PlatformPlt

Documentation / agent files (template PR #51)

  • README.md: replaced ### Self-Validation Tests table with a ## Self Validation section showing actual sonarmark --validate output format with test names and checkmarks
  • docs/guide/guide.md: restructured self-validation chapter — added Validation Report subsection with actual output example; consolidated saving results into Running Validation; updated Validation Tests to bullet list with test names
  • .markdownlint-cli2.jsonc: added MD024: siblings_only: true to allow sibling Self-Validation headings
  • AGENTS.md: C# 12C# (latest); .markdownlint.json.markdownlint-cli2.jsonc
  • code-quality-agent.md: .markdownlint.json.markdownlint-cli2.jsonc
  • repo-consistency-agent.md: same filename fix; adds Tracking Template Evolution section (4-step PR review process for catching future drift)
  • requirements-agent.md: adds Test Source Filters section documenting windows@, ubuntu@, net8.0@, etc. prefixes and warning against accidental removal
  • pull_request_template.md: adds self-validation checklist item

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

  • Markdown linter passes: npx markdownlint-cli2 "**/*.md" "#node_modules"
  • Spell checker passes: npx cspell "**/*.{md,cs}" --no-progress
  • YAML linter passes: yamllint .

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

All 76 tests pass across net8.0/net9.0/net10.0. Code review passed with no comments.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits March 4, 2026 01:18
- Program.cs: route errors to Console.Error.WriteLine (stderr)
- Program.cs: version display uses context.WriteLine (respects --silent)
- Context.cs: add AutoFlush=true on log StreamWriter
- Context.cs: WriteError uses Console.Error.WriteLine (stderr)
- Tests: update to capture Console.Error for error assertions
- Tests.csproj: LangVersion 12 → latest
- SonarMark.csproj: reorganize packages into labeled ItemGroups
- build.yaml: add dotnet tool restore step to CodeQL job
- build.yaml: add sonarmark to versionmark capture list
- pull_request_template.md: add self-validation checklist item

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
- AGENTS.md: C# 12 → C# (latest), .markdownlint.json → .markdownlint-cli2.jsonc
- code-quality-agent.md: .markdownlint.json → .markdownlint-cli2.jsonc
- repo-consistency-agent.md: fix markdownlint filename, add Tracking Template Evolution section
- requirements-agent.md: add Test Source Filters section

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

@copilot Can you re-check - I don't think this pulled in all the updates. The requirements aren't semantic, the self-validation still prints descriptions rather than test names. The self-validation sections of the README.md and user guide don't match the layout of the template. Please re-execute the repo-consistency agent and actually check the pull-requests of the template.

Copilot AI changed the title [WIP] Update project with recent template updates Apply TemplateDotNetTool template consistency updates to SonarMark Mar 4, 2026
Copilot AI and others added 2 commits March 4, 2026 01:30
…d/Failed

- Output now shows test names (SonarMark_QualityGateRetrieval) instead of descriptions
- Status now uses title case (Passed/Failed) consistent with template PR #51
- Removed unused 'displayName' parameter from RunValidationTest

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
- requirements.yaml: semantic IDs (CLI-001 → Sonar-Cmd-Cli, PLT-001 → Sonar-Platform-Windows, etc.)
- README.md: replace Self-Validation Tests table with Self Validation section showing actual output format
- docs/guide/guide.md: restructure self-validation section with Validation Report example (template PR #51)
- .markdownlint-cli2.jsonc: allow siblings_only duplicate headings for Self-Validation

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

Copilot AI commented Mar 4, 2026

@copilot Can you re-check - I don't think this pulled in all the updates. The requirements aren't semantic, the self-validation still prints descriptions rather than test names. The ...

Done — addressed in commits 1986a3a and 545e0eb:

Validation.cs (template PR #51): Console output now shows test names (SonarMark_QualityGateRetrieval - Passed) instead of descriptions (Quality Gate Retrieval Test - PASSED). Removed the unused displayName parameter.

requirements.yaml (template PR #50): Applied semantic IDs throughout — e.g. CLI-001Sonar-Cmd-Cli, PLT-001Sonar-Platform-Windows, SONAR-003Sonar-Server-QualityGate, etc.

README.md + docs/guide/guide.md (template PR #51): Self-validation sections now show the actual output format with test names and checkmarks, matching the template layout.

- title: Command-Line Interface
requirements:
- id: CLI-001
- id: Sonar-Cmd-Cli
Copy link
Contributor

Choose a reason for hiding this comment

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

I think ALL requirements should start with "SonarMark-" as that's the tool name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in c550cf7 — all requirement IDs now start with SonarMark- (e.g. SonarMark-Cmd-Cli, SonarMark-Svr-Connect, SonarMark-Rpt-Markdown, SonarMark-Plt-Windows).

- title: SonarQube/SonarCloud Integration
requirements:
- id: SONAR-001
- id: Sonar-Server-Connect
Copy link
Contributor

Choose a reason for hiding this comment

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

I think all "Server" requirements should be "Svr" to keep them short.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in c550cf7 — all server requirement IDs now use Svr (e.g. SonarMark-Svr-Connect, SonarMark-Svr-Auth, SonarMark-Svr-QualityGate).

- title: Report Generation
requirements:
- id: RPT-001
- id: Sonar-Report-Markdown
Copy link
Contributor

Choose a reason for hiding this comment

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

I think all Report requirements should be "Rpt" for keeping them short.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in c550cf7 — all report requirement IDs now use Rpt (e.g. SonarMark-Rpt-Markdown, SonarMark-Rpt-Depth, SonarMark-Rpt-QualityGate).

- title: Platform Support
requirements:
- id: PLT-001
- id: Sonar-Platform-Windows
Copy link
Contributor

Choose a reason for hiding this comment

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

I think all Platform requirements should be "Plt"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in c550cf7 — all platform requirement IDs now use Plt (e.g. SonarMark-Plt-Windows, SonarMark-Plt-Linux, SonarMark-Plt-Net8).

…bbreviations

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
@Malcolmnixon Malcolmnixon marked this pull request as ready for review March 4, 2026 03:10
@Malcolmnixon Malcolmnixon merged commit 4aa6fbe into main Mar 4, 2026
11 checks passed
@Malcolmnixon Malcolmnixon deleted the copilot/update-template-project branch March 4, 2026 03:10
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