Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HdfConverter: SARIF location improvements #2704

Merged
merged 6 commits into from
Aug 23, 2023
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
4 changes: 2 additions & 2 deletions ReleaseHistory.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SARIF Package Release History (SDK, Driver, Converters, and Multitool)
## Unreleased

## **v4.3.1** UNRELEASED
* BUG: Improve `HdfConverter` ensure uri data is populated and to provide location and region data property from `SourceLocation`. [#2704](https://github.com/microsoft/sarif-sdk/pull/2704)
* BUG: Correct `run.language` regex in JSON schema. [#2708]https://github.com/microsoft/sarif-sdk/pull/2708

## **v4.3.0** [Sdk](https://www.nuget.org/packages/Sarif.Sdk/v4.3.0) | [Driver](https://www.nuget.org/packages/Sarif.Driver/v4.3.0) | [Converters](https://www.nuget.org/packages/Sarif.Converters/v4.3.0) | [Multitool](https://www.nuget.org/packages/Sarif.Multitool/v4.3.0) | [Multitool Library](https://www.nuget.org/packages/Sarif.Multitool.Library/v4.3.0)
Expand Down
6 changes: 3 additions & 3 deletions src/Sarif.Converters/HdfConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,14 @@ private static (ReportingDescriptor, IList<Result>) SarifRuleAndResultFromHdfCon
{
ArtifactLocation = new ArtifactLocation
{
Uri = new Uri(".", UriKind.Relative),
Uri = new Uri(execJsonControl.SourceLocation.Ref ?? "file:///", UriKind.RelativeOrAbsolute),
UriBaseId = "ROOTPATH",
},
Region = new Region
{
StartLine = 1,
StartLine = execJsonControl.SourceLocation.Line ?? 1,
StartColumn = 1,
EndLine = 1,
EndLine = execJsonControl.SourceLocation.Line ?? 1,
EndColumn = 1,
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Sarif.Converters/HdfModel/SourceLocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ public partial class SourceLocation
/// <summary>
/// The line at which this statement is located in the file
/// </summary>
[JsonProperty("line", Required = Required.Default)]
public double Line { get; set; }
[JsonProperty("line", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
public int? Line { get; set; }

/// <summary>
/// Path to the file that this statement originates from
/// </summary>
[JsonProperty("ref", Required = Required.Default)]
[JsonProperty("ref", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
public string Ref { get; set; }
}
}
Loading
Loading