Skip to content

Commit

Permalink
feat: expose LicenseUrl in output
Browse files Browse the repository at this point in the history
  • Loading branch information
U52284 committed Feb 28, 2024
1 parent a8e85c5 commit f9f6a7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/NuGetUtility/LicenseValidator/LicenseValidationResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ public record LicenseValidationResult(string PackageId,
INuGetVersion PackageVersion,
string? PackageProjectUrl,
string? License,
string? LicenseUrl,
LicenseInformationOrigin LicenseInformationOrigin,
List<ValidationError>? ValidationErrors = null)
{
public List<ValidationError> ValidationErrors { get; } = ValidationErrors ?? new List<ValidationError>();

public string? License { get; set; } = License;
public string? LicenseUrl { get; set; } = LicenseUrl;
public LicenseInformationOrigin LicenseInformationOrigin { get; set; } = LicenseInformationOrigin;
}
}
2 changes: 2 additions & 0 deletions src/NuGetUtility/LicenseValidator/LicenseValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ private void AddOrUpdateLicense(
info.Identity.Version,
info.ProjectUrl?.ToString(),
license,
info.LicenseUrl?.AbsoluteUri,
origin,
new List<ValidationError> { error });
result.AddOrUpdate(new LicenseNameAndVersion(info.Identity.Id, info.Identity.Version),
Expand All @@ -97,6 +98,7 @@ private void AddOrUpdateLicense(
info.Identity.Version,
info.ProjectUrl?.ToString(),
license,
info.LicenseUrl?.AbsoluteUri,
origin);
result.AddOrUpdate(new LicenseNameAndVersion(info.Identity.Id, info.Identity.Version),
newValue,
Expand Down

0 comments on commit f9f6a7e

Please sign in to comment.