Skip to content

Add configurable SarifLevel property to ToolConfig - #12

Merged
mr-miles merged 1 commit into
mainfrom
hhh
Apr 18, 2026
Merged

mr-miles merged 1 commit into
mainfrom
hhh

Conversation

@mr-miles

Copy link
Copy Markdown
Owner

Exposes a sarifLevel config option (default "warning") that controls the SARIF result level emitted by SarifReporter. Valid values mirror SARIF 2.1.0: error, warning, note, none. The example config uses "note".

Exposes a `sarifLevel` config option (default "warning") that controls
the SARIF result level emitted by SarifReporter. Valid values mirror
SARIF 2.1.0: error, warning, note, none. The example config uses "note".
if (outputSarif.Name == "-")
{
await sarifReporter.WriteAsync(result, Console.OpenStandardOutput());
await sarifReporter.WriteAsync(result, Console.OpenStandardOutput(), config.SarifLevel);
{
using var stream = outputSarif.Open(FileMode.Create);
await sarifReporter.WriteAsync(result, stream);
await sarifReporter.WriteAsync(result, stream, config.SarifLevel);
Comment on lines +25 to +26
public string SarifLevel { get; init; } = "warning";

object[] Runs);

public async Task WriteAsync(CrossReferenceResult result, Stream stream)
public async Task WriteAsync(CrossReferenceResult result, Stream stream, string level = "warning")
{
ruleId = "DC001",
level = "warning",
level,
@github-actions

Copy link
Copy Markdown

✅ PR Diff Coverage

Metric Value
Added lines 6
Covered 0
Uncovered 6
Coverage 0%

Uncovered lines are shown as inline annotations on the diff.

@mr-miles
mr-miles merged commit fac6b36 into main Apr 18, 2026
5 checks passed
@mr-miles
mr-miles deleted the hhh branch April 18, 2026 17:19
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