Skip to content
Draft
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
19 changes: 14 additions & 5 deletions src/Cake.Issues.Sarif/SarifIssuesProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

var (text, markdown) = GetMessage(sarifResult, run);
var (ruleId, ruleUrl) = GetRule(sarifResult, run);
var (filePath, startLine, endLine, startColumn, endColumn) = GetLocation(sarifResult, this.Settings);

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

Cannot deconstruct a tuple of '7' elements into '5' variables.

Check failure on line 51 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

Cannot deconstruct a tuple of '7' elements into '5' variables.

// Build issue.
var issueBuilder =
Expand Down Expand Up @@ -179,9 +179,16 @@
/// </summary>
/// <param name="result">Result to read the location from.</param>
/// <param name="repositorySettings">Repository settings.</param>
/// <returns>File and line of the result.</returns>
private static (string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn) GetLocation(
Result result, IRepositorySettings repositorySettings)
/// <returns>Location information for the result.</returns>
private static (
string FilePath,
int? StartLine,
int? EndLine,
int? StartColumn,
int? EndColumn,
string snippet,

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

Check warning on line 189 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

string sourceLanguage)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

Check warning on line 190 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

GetLocation(Result result, IRepositorySettings repositorySettings)
{
result.NotNull();

Expand Down Expand Up @@ -233,13 +240,15 @@

if (!pathValidationResult)
{
return (null, null, null, null, null);
return (null, null, null, null, null, null, null);
}

int? startLine = null;
int? endLine = null;
int? startColumn = null;
int? endColumn = null;
string snippet = null;
string sourceLanguage = null;
if (location.PhysicalLocation.Region != null)
{
startLine = location.PhysicalLocation.Region.StartLine > 0 ? location.PhysicalLocation.Region.StartLine : null;
Expand All @@ -248,10 +257,10 @@
endColumn = location.PhysicalLocation.Region.EndColumn > 0 ? location.PhysicalLocation.Region.EndColumn : null;
}

return (filePath, startLine, endLine, startColumn, endColumn);
return (filePath, startLine, endLine, startColumn, endColumn, snippet, sourceLanguage);
}

return (null, null, null, null, null);

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-22.04)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Build

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2025)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-24.04)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.

Check failure on line 263 in src/Cake.Issues.Sarif/SarifIssuesProvider.cs

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-2022)

Tuple with 5 elements cannot be converted to type '(string FilePath, int? StartLine, int? EndLine, int? StartColumn, int? EndColumn, string snippet, string sourceLanguage)'.
}

/// <summary>
Expand Down
Loading