You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Initial plan
* feat: add SARIF report output support with shared RuleSeverity/RuleMetadata layer
- Rename SonarRuleSeverity → RuleSeverity in Core/Reporting/
- Add RuleMetadata record and RuleMetadataProvider static class
- Add SarifReporter with SARIF 2.1.0 DTOs (no external NuGet deps)
- Add --sarif-report-file CLI option and wire into ValidatorRunner
- Update all SonarRuleSeverity references to RuleSeverity
- Add SarifReporterTests with snapshot tests
- Update README with SARIF docs and GitHub Code Scanning example
Agent-Logs-Url: https://github.com/304NotModified/SLNX-validator/sessions/5d6c6f75-d638-45f6-a4ec-d404d306a102
Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>
* refactor: address PR review comments
- Split SarifModels.cs into individual files per class
- Add XML doc comments to RuleSeverity enum with SARIF/SonarQube mapping
- Move --sarif-report-file section before --continue-on-error in README
- Remove unclear .sarif.json tip line from README
- Update severity override flags table to include SARIF level column
- Add short SARIF explanation to GitHub Code Scanning section
Agent-Logs-Url: https://github.com/304NotModified/SLNX-validator/sessions/c8bac85a-7f8b-43c1-911f-a7724715655c
Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>
* refactor: address second round of PR review comments
- Rename RuleMetadata -> Rule, RuleMetadataProvider -> RuleProvider
- Convert switch expression in RuleProvider to private dictionary
- Remove <remarks> block from RuleSeverity (keep per-value <summary>)
- README: expand --sarif-report-file section with SARIF intro, benefits, links, viewers
- README: add internal links in severity mapping section
- README: update severity override description to mention console + SQ + SARIF
Agent-Logs-Url: https://github.com/304NotModified/SLNX-validator/sessions/24076cbf-30ba-4777-8367-61481287936c
Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>
* refactor: address third round of PR review comments
- RuleProvider: add Create() helper with default MAJOR severity to eliminate repeated code.ToCode() and explicit MAJOR
- README: replace VS Code -> Visual Studio Code, VS -> Visual Studio throughout
- README: fix out-of-the-box claim (Visual Studio built-in, VS Code/Azure DevOps need extensions)
- README: fix Visual Studio link to SARIF viewer docs (was Roslyn analyzers)
- README: fix Azure DevOps link to SARIF SAST Scans Tab extension (was code coverage docs)
Agent-Logs-Url: https://github.com/304NotModified/SLNX-validator/sessions/f238c504-01a4-4790-a858-136add863e89
Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>
* refactor: address fourth round of PR review comments
- RuleProvider: dedup error codes by having Create() return (Key, Rule) tuple,
build dictionary via .ToDictionary() so each ValidationErrorCode only appears once
- RuleProvider: rename rules: "Input file not found" -> "SLNX file not found",
"Invalid file extension" -> "Invalid solution file extension",
"File is not a text file" -> "SLNX file is not a text file"
- Update snapshot tests to match new rule names
- README: link "Visual Studio" in benefits bullet to official SARIF viewer docs
- README: viewers section - Visual Studio/Code/Azure DevOps no longer hyperlinks;
only the extension/docs links are clickable, no duplicate links
Agent-Logs-Url: https://github.com/304NotModified/SLNX-validator/sessions/e6c871f9-f7c6-4137-9c1d-716db710bb21
Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>
* fix: correct Visual Studio SARIF viewer - requires extension, not built-in
The previously linked docs URL returned 404. Visual Studio does not have
a built-in SARIF viewer; it requires the Microsoft SARIF Viewer extension.
- Benefits bullet: removed "built-in" claim, now says "via extensions for
Visual Studio, Visual Studio Code, and Azure DevOps"
- Viewers list: Visual Studio entry now links to the correct Marketplace
extension (WDGIS.MicrosoftSarifViewer2022)
Agent-Logs-Url: https://github.com/304NotModified/SLNX-validator/sessions/273158ae-504a-46bd-9190-2e9f6a642aa7
Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>
[SARIF](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html) (Static Analysis Results Interchange Format) is an open OASIS standard for static analysis tool output. It enables interoperability between analysis tools and result viewers, so the same report can be consumed by GitHub Code Scanning, Azure DevOps, Visual Studio, Visual Studio Code, and other tools without any conversion.
67
+
68
+
**Benefits of SARIF:**
69
+
- Native integration with [GitHub Code Scanning](https://docs.github.com/en/code-security/code-scanning) — issues appear as alerts in the **Security → Code Scanning** tab
70
+
- Supported via extensions for Visual Studio, Visual Studio Code, and Azure DevOps
71
+
- Rich result format: rule metadata, severity, file paths, and line numbers in a single file
72
+
- Widely adopted standard — see [SARIF tutorials](https://github.com/microsoft/sarif-tutorials) and the [SARIF web viewer](https://sarifweb.azurewebsites.net/)
Severity mapping from `RuleSeverity` to SARIF levels (see also the [GitHub Code Scanning integration example](#github-code-scanning-integration-example)):
81
+
82
+
| Severity | SARIF level |
83
+
|----------|-------------|
84
+
|`BLOCKER`, `CRITICAL`, `MAJOR`|`error`|
85
+
|`MINOR`|`warning`|
86
+
|`INFO`|`note`|
87
+
88
+
Severity overrides (via `--minor`, `--info`, `--ignore`, etc.) are reflected in the SARIF output. See [Severity override flags](#severity-override-flags) for details.
89
+
90
+
**Viewers and reporting:**
91
+
-[GitHub Code Scanning](https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github) — upload via `github/codeql-action/upload-sarif@v3` (see [example below](#github-code-scanning-integration-example))
92
+
- Visual Studio — requires the [Microsoft SARIF Viewer extension](https://marketplace.visualstudio.com/items?itemName=WDGIS.MicrosoftSarifViewer2022)
93
+
- Visual Studio Code — requires the [SARIF Viewer extension](https://marketplace.visualstudio.com/items?itemName=MS-SarifVSCode.sarif-viewer)
Always exits with code `0`, even when validation errors are found. Useful in CI pipelines where SonarQube handles the failure decision. Default: `false`.
101
+
Always exits with code `0`, even when validation errors are found. Useful in CI pipelines where SonarQube or GitHub Code Scanning handles the failure decision. Default: `false`.
Override the severity of specific validation codes, or suppress them entirely. This controls both the exit code behaviourand the severity written to the SonarQube JSON report.
158
+
Override the severity of specific validation codes, or suppress them entirely. This controls the exit code behaviour, the console output label, and the severity written to SonarQube and SARIF reports.
124
159
125
-
| Flag | Severity | Causes exit code `1`? |
126
-
|------|----------|-----------------------|
127
-
|`--blocker <codes>`|`BLOCKER`| ✅ yes |
128
-
|`--critical <codes>`|`CRITICAL`| ✅ yes |
129
-
|`--major <codes>`|`MAJOR`| ✅ yes (default for all codes) |
130
-
|`--minor <codes>`|`MINOR`| ❌ no — shown with `(warning)` label |
131
-
|`--info <codes>`|`INFO`| ❌ no — shown with `(info)` label |
132
-
|`--ignore <codes>`|*(suppressed)*| ❌ no — not shown at all, not in SonarQube report |
This uploads the validation results to the **Security → Code Scanning** tab of your repository. Issues appear as alerts with rule descriptions, file locations, and links back to the relevant lines.
0 commit comments