diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index ad92f24..b040cd4 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -37,6 +37,12 @@ "commands": [ "reqstream" ] + }, + "demaconsulting.sonarmark": { + "version": "1.0.0", + "commands": [ + "sonarmark" + ] } } } \ No newline at end of file diff --git a/.cspell.json b/.cspell.json index b42023d..5bee7d6 100644 --- a/.cspell.json +++ b/.cspell.json @@ -21,6 +21,7 @@ "fsproj", "Gidget", "gitattributes", + "hotspots", "ibiqlik", "LINQ", "maintainer", @@ -39,6 +40,7 @@ "snupkg", "Sonar", "sonarcloud", + "sonarmark", "sonarscanner", "spdx", "TestResults", diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9fec8f8..153878d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -248,6 +248,32 @@ jobs: docs/tracematrix/tracematrix.html "docs/TestResults Trace Matrix.pdf" + - name: Generate Code Quality Report with SonarMark + shell: pwsh + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: > + dotnet sonarmark + --server https://sonarcloud.io + --project-key demaconsulting_TestResults + --branch ${{ github.ref_name }} + --token "$env:SONAR_TOKEN" + --report docs/quality/sonar-quality.md + --report-depth 1 + + - name: Generate Code Quality HTML with Pandoc + run: > + dotnet pandoc + docs/quality/title.txt + --defaults docs/quality/definition.yaml + --output docs/quality/quality.html + + - name: Generate Code Quality PDF with Weasyprint + run: > + dotnet weasyprint + docs/quality/quality.html + "docs/TestResults Code Quality.pdf" + - name: Upload Documentation uses: actions/upload-artifact@v6 with: diff --git a/docs/quality/definition.yaml b/docs/quality/definition.yaml new file mode 100644 index 0000000..c18be4b --- /dev/null +++ b/docs/quality/definition.yaml @@ -0,0 +1,14 @@ +--- +resource-path: + - docs/quality + - docs/template + +input-files: + - docs/quality/introduction.md + - docs/quality/sonar-quality.md + +template: template.html + +table-of-contents: true + +number-sections: true diff --git a/docs/quality/introduction.md b/docs/quality/introduction.md new file mode 100644 index 0000000..f88f9a7 --- /dev/null +++ b/docs/quality/introduction.md @@ -0,0 +1,35 @@ +# Introduction + +This document contains the code quality analysis report for the TestResults project. + +## Purpose + +This report serves as evidence that the TestResults codebase maintains good quality +standards. It provides a comprehensive analysis of code quality metrics, including +quality gate status, code issues, security hotspots, technical debt, and code coverage. + +## Scope + +This code quality report covers: + +- Quality gate status and conditions +- Code issues categorized by type and severity +- Security hotspots requiring review +- Technical debt assessment +- Code coverage and duplication metrics + +## Analysis Source + +This report contains quality analysis results captured at the time this version of TestResults +was built. It serves as evidence that the code maintains good quality standards and provides +transparency about the project's code health. The analysis includes results from various +quality tools run during the build process. + +## Audience + +This document is intended for: + +- Software developers working on TestResults +- Quality assurance teams reviewing code quality +- Project stakeholders evaluating project health +- Contributors understanding quality standards diff --git a/docs/quality/title.txt b/docs/quality/title.txt new file mode 100644 index 0000000..b021208 --- /dev/null +++ b/docs/quality/title.txt @@ -0,0 +1,18 @@ +--- +title: TestResults Library +subtitle: Code Quality Report +author: DEMA Consulting +description: Code Quality Report for the TestResults C# library for creating test result files in TRX and JUnit XML formats +lang: en-US +keywords: + - TestResults + - Code Quality + - SonarCloud + - Analysis + - C# + - .NET + - TRX + - JUnit + - Test Results + - Testing +---