C#: Address review comments.

This commit is contained in:
Michael Nebel
2025-11-17 16:03:53 +01:00
parent 90dbb7a8eb
commit 138441b662
4 changed files with 10 additions and 5 deletions

View File

@@ -57,6 +57,6 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
}
}
public override string ToString() => DirInfo.FullName.ToString();
public override string ToString() => DirInfo.FullName;
}
}

View File

@@ -24,8 +24,8 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
private readonly FileProvider fileProvider;
/// <summary>
/// The computed packages directory.
/// This will be in the Cached or Temp location
/// The packages directory.
/// This will be in the user-specified or computed Temp location
/// so as to not trample the source tree.
/// </summary>
private readonly DependencyDirectory packageDirectory;

View File

@@ -79,9 +79,8 @@ namespace Semmle.Util
/// <summary>
/// If set, returns the directory where buildless dependencies should be stored.
/// This is needed for caching dependencies.
/// This can be used for caching dependencies.
/// </summary>
/// <returns></returns>
public static string? GetBuildlessDependencyDir()
{
return Environment.GetEnvironmentVariable("CODEQL_EXTRACTOR_CSHARP_OPTION_BUILDLESS_DEPENDENCY_DIR");

View File

@@ -1,4 +1,5 @@
import os
import shutil
def test(codeql, csharp, cwd):
path = os.path.join(cwd, "dependencies")
@@ -6,3 +7,8 @@ def test(codeql, csharp, cwd):
# The Assemblies.ql query shows that the Newtonsoft assembly is found in the
# dependency directory set above.
codeql.database.create(source_root="proj", build_mode="none")
# Check that the packages directory has been created in the dependecies folder.
packages_dir = os.path.join(path, "packages")
assert os.path.isdir(packages_dir), "The packages directory was not created in the specified dependency directory."
shutil.rmtree(path)