mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C#: Address review comments.
This commit is contained in:
@@ -57,6 +57,6 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString() => DirInfo.FullName.ToString();
|
||||
public override string ToString() => DirInfo.FullName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user