Skip to content

Commit 917fcc3

Browse files
committed
Configure dotnet component factory
1 parent 6cdaa20 commit 917fcc3

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/Microsoft.ComponentDetection.Detectors/linux/Factories/DotnetComponentFactory.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ public class DotnetComponentFactory : ArtifactComponentFactoryBase
1414
public override IEnumerable<string> SupportedArtifactTypes => ["dotnet"];
1515

1616
/// <inheritdoc/>
17-
public override TypedComponent? CreateComponent([NotNull] ArtifactElement artifact, [NotNull] Distro distro)
17+
public override TypedComponent? CreateComponent(
18+
[NotNull] ArtifactElement artifact,
19+
[NotNull] Distro distro
20+
)
1821
{
1922
if (string.IsNullOrWhiteSpace(artifact.Name) || string.IsNullOrWhiteSpace(artifact.Version))
2023
{
@@ -24,9 +27,6 @@ public class DotnetComponentFactory : ArtifactComponentFactoryBase
2427
var author = GetAuthorFromArtifact(artifact);
2528
var authors = string.IsNullOrWhiteSpace(author) ? null : new[] { author };
2629

27-
return new NuGetComponent(
28-
name: artifact.Name,
29-
version: artifact.Version,
30-
authors: authors);
30+
return new NuGetComponent(name: artifact.Name, version: artifact.Version, authors: authors);
3131
}
3232
}

src/Microsoft.ComponentDetection.Detectors/linux/LinuxScanner.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ IEnumerable<IArtifactFilter> artifactFilters
8787
},
8888
{ ComponentType.Npm, componentFactories.FirstOrDefault(f => f is NpmComponentFactory) },
8989
{ ComponentType.Pip, componentFactories.FirstOrDefault(f => f is PipComponentFactory) },
90+
{
91+
ComponentType.NuGet,
92+
componentFactories.FirstOrDefault(f => f is DotnetComponentFactory)
93+
},
9094
};
9195
}
9296

0 commit comments

Comments
 (0)