Skip to content

Commit eb23d31

Browse files
committed
C#: Address review comments.
1 parent 399b685 commit eb23d31

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DependencyDirectory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ public void Dispose()
5757
}
5858
}
5959

60-
public override string ToString() => DirInfo.FullName.ToString();
60+
public override string ToString() => DirInfo.FullName;
6161
}
6262
}

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetExeWrapper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ internal class NugetExeWrapper : IDisposable
2424
private readonly FileProvider fileProvider;
2525

2626
/// <summary>
27-
/// The computed packages directory.
28-
/// This will be in the Cached or Temp location
27+
/// The packages directory.
28+
/// This will be in the user-specified or computed Temp location
2929
/// so as to not trample the source tree.
3030
/// </summary>
3131
private readonly DependencyDirectory packageDirectory;

csharp/extractor/Semmle.Util/EnvironmentVariables.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ public static IEnumerable<string> GetURLs(string name)
7979

8080
/// <summary>
8181
/// If set, returns the directory where buildless dependencies should be stored.
82-
/// This is needed for caching dependencies.
82+
/// This can be used for caching dependencies.
8383
/// </summary>
84-
/// <returns></returns>
8584
public static string? GetBuildlessDependencyDir()
8685
{
8786
return Environment.GetEnvironmentVariable("CODEQL_EXTRACTOR_CSHARP_OPTION_BUILDLESS_DEPENDENCY_DIR");
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import os
2+
import shutil
23

34
def test(codeql, csharp, cwd):
45
path = os.path.join(cwd, "dependencies")
56
os.environ["CODEQL_EXTRACTOR_CSHARP_OPTION_BUILDLESS_DEPENDENCY_DIR"] = path
67
# The Assemblies.ql query shows that the Newtonsoft assembly is found in the
78
# dependency directory set above.
89
codeql.database.create(source_root="proj", build_mode="none")
10+
11+
# Check that the packages directory has been created in the dependecies folder.
12+
packages_dir = os.path.join(path, "packages")
13+
assert os.path.isdir(packages_dir), "The packages directory was not created in the specified dependency directory."
14+
shutil.rmtree(path)

0 commit comments

Comments
 (0)