C#: Fix problem with logging unused packages. The dependencies only contains the paths relative to the package directory.

This commit is contained in:
Michael Nebel
2023-12-01 15:24:33 +01:00
parent 4ef1fe49e3
commit aec070f918

View File

@@ -345,12 +345,13 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
return new DirectoryInfo(packageDirectory.DirInfo.FullName)
.EnumerateDirectories("*", new EnumerationOptions { MatchCasing = MatchCasing.CaseInsensitive, RecurseSubdirectories = false })
.Select(d => d.FullName);
.Select(d => d.Name);
}
private void LogAllUnusedPackages(DependencyContainer dependencies) =>
GetAllPackageDirectories()
.Where(package => !dependencies.Packages.Contains(package))
.Order()
.ForEach(package => progressMonitor.LogInfo($"Unused package: {package}"));
private void GenerateSourceFileFromImplicitUsings()