Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/reqstream/sarifmark-system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ sections:
requirements:
- id: SarifMark-System-Version
title: The tool shall display version information when the version flag is provided.
tags: [public]
justification: >-
Users need to quickly identify the version of the tool they are using for
troubleshooting and compatibility verification.
Expand All @@ -20,6 +21,7 @@ sections:

- id: SarifMark-System-Help
title: The tool shall display help information when the help flag is provided.
tags: [public]
justification: >-
Help information improves discoverability and usability by providing users with guidance
on available options and parameters.
Expand All @@ -28,6 +30,7 @@ sections:

- id: SarifMark-System-Validate
title: The tool shall support self-validation mode.
tags: [public]
justification: >-
Self-validation mode enables verification that the tool operates correctly in
the deployment environment.
Expand All @@ -36,6 +39,7 @@ sections:

- id: SarifMark-System-SarifAnalysis
title: The tool shall read and analyze SARIF files.
tags: [public]
justification: >-
Reading and analyzing SARIF files is the core purpose of the tool, enabling
integration with static analysis workflows.
Expand All @@ -44,6 +48,7 @@ sections:

- id: SarifMark-System-Report
title: The tool shall generate markdown reports from SARIF files.
tags: [public]
justification: >-
Markdown report generation makes SARIF analysis results accessible to
stakeholders in a readable format.
Expand All @@ -52,27 +57,31 @@ sections:

- id: SarifMark-System-Enforce
title: The tool shall return non-zero exit code when enforcement mode detects issues.
tags: [public]
justification: >-
Non-zero exit codes enable CI/CD pipeline integration for quality gates.
tests:
- IntegrationTest_EnforceFlagWithIssues_ReturnsError

- id: SarifMark-System-Silent
title: The tool shall support silent mode to suppress console output.
tags: [public]
justification: >-
Silent mode enables cleaner integration into automated workflows.
tests:
- IntegrationTest_SilentFlag_SuppressesOutput

- id: SarifMark-System-LogFile
title: The tool shall support writing output to a log file.
tags: [public]
justification: >-
Log file support enables persistent record-keeping and audit trails.
tests:
- IntegrationTest_LogFile_WritesOutputToFile

- id: SarifMark-System-InvalidArgs
title: The tool shall reject unknown command-line arguments with an error.
tags: [public]
justification: >-
Rejecting unknown arguments prevents silent failures from typos.
tests:
Expand Down
5 changes: 3 additions & 2 deletions src/DemaConsulting.SarifMark/Sarif/SarifResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,10 @@ private static (string? Uri, int? StartLine) ParseLocation(JsonElement resultEle
private static int? ParseStartLine(JsonElement physicalLocationElement)
{
if (physicalLocationElement.TryGetProperty("region", out var regionElement) &&
regionElement.TryGetProperty("startLine", out var startLineElement))
regionElement.TryGetProperty("startLine", out var startLineElement) &&
startLineElement.TryGetInt32(out var startLine))
{
return startLineElement.GetInt32();
return startLine;
}

return null;
Expand Down
Loading