-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99b4a66
commit e1ac282
Showing
20 changed files
with
160 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/CreateSarifReportTask.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using Cake.Common.IO; | ||
using Cake.Issues; | ||
using Cake.Issues.Reporting; | ||
using Cake.Issues.Reporting.Sarif; | ||
|
||
namespace Cake.Frosting.Issues.Recipe | ||
{ | ||
/// <summary> | ||
/// Creates issue report in SARIF format. | ||
/// </summary> | ||
[TaskName("Create-SarifReport")] | ||
[IsDependentOn(typeof(ReadIssuesTask))] | ||
public sealed class CreateSarifReportTask : FrostingTask<IIssuesContext> | ||
{ | ||
/// <inheritdoc/> | ||
public override bool ShouldRun(IIssuesContext context) | ||
{ | ||
context.NotNull(nameof(context)); | ||
|
||
return context.Parameters.Reporting.ShouldCreateSarifReport; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override void Run(IIssuesContext context) | ||
{ | ||
context.NotNull(nameof(context)); | ||
|
||
var reportFileName = "report"; | ||
if (!string.IsNullOrWhiteSpace(context.Parameters.BuildIdentifier)) | ||
{ | ||
reportFileName += $"-{context.Parameters.BuildIdentifier}"; | ||
} | ||
reportFileName += ".sarif"; | ||
|
||
context.State.SarifReport = | ||
context.Parameters.OutputDirectory.CombineWithFilePath(reportFileName); | ||
context.EnsureDirectoryExists(context.Parameters.OutputDirectory); | ||
|
||
// Create SARIF report. | ||
context.CreateIssueReport( | ||
context.State.Issues, | ||
context.SarifIssueReportFormat(), | ||
context.State.ProjectRootDirectory, | ||
context.State.SarifReport); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters