Skip to content

Commit

Permalink
Fixes and update to change log
Browse files Browse the repository at this point in the history
  • Loading branch information
BernieWhite committed Nov 14, 2023
1 parent 7895254 commit 39c176d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions docs/CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ See [upgrade notes][1] for helpful information when upgrading from previous vers

## Unreleased

What's changed since pre-release v3.0.0-B0084:

- Engineering:
- Bump Sarif.Sdk to v4.3.7.
[#1667](https://github.com/microsoft/PSRule/pull/1667)

## v3.0.0-B0084 (pre-release)

What's changed since release v2.9.0:
Expand Down
1 change: 1 addition & 0 deletions src/PSRule/PSRule.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
</PackageReference>
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1" PrivateAssets="All" />
<PackageReference Include="Sarif.Sdk" Version="4.3.7" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<!-- Add code generators -->
Expand Down
9 changes: 5 additions & 4 deletions src/PSRule/Pipeline/Output/SarifOutputWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ internal sealed class SarifBuilder
{
private const string TOOL_NAME = "PSRule";
private const string TOOL_ORG = "Microsoft Corporation";
private const string TOOL_GUID = "0130215d-58eb-4887-b6fa-31ed02500569";
private const string RECOMMENDATION_MESSAGE_ID = "recommendation";
private const string LOCATION_KIND_OBJECT = "object";
private const string LOCATION_ID_REPOROOT = "REPOROOT";

private static readonly Guid _ToolGuid = new("0130215d-58eb-4887-b6fa-31ed02500569");

private readonly Run _Run;
private readonly Dictionary<string, ReportingDescriptorReference> _Rules;
private readonly Dictionary<string, ToolComponent> _Extensions;
Expand Down Expand Up @@ -104,7 +105,7 @@ public void Add(RuleRecord record)
};

// SARIF2004: Use the RuleId property instead of Rule for standalone rules.
if (rule.ToolComponent.Guid == TOOL_GUID)
if (rule.ToolComponent.Guid == _ToolGuid)
{
result.RuleId = rule.Id;
result.Rule = null;
Expand Down Expand Up @@ -291,7 +292,7 @@ private Tool GetTool(Source[] source)
Name = TOOL_NAME,
SemanticVersion = version,
Organization = TOOL_ORG,
Guid = TOOL_GUID,
Guid = _ToolGuid,
Rules = new List<ReportingDescriptor>(),
InformationUri = new Uri("https://aka.ms/ps-rule", UriKind.Absolute),
},
Expand All @@ -313,7 +314,7 @@ private IList<ToolComponent> GetExtensions(Source[] source)
{
Name = source[i].Module.Name,
Version = source[i].Module.Version,
Guid = source[i].Module.Guid,
Guid = new Guid(source[i].Module.Guid),
AssociatedComponent = new ToolComponentReference
{
Name = TOOL_NAME,
Expand Down

0 comments on commit 39c176d

Please sign in to comment.