Skip to content

Commit d33b157

Browse files
committed
C#: Address review comments.
1 parent 8add898 commit d33b157

7 files changed

Lines changed: 28 additions & 28 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ private ProcessStartInfo MakeDotnetStartInfo(List<string> args, string? workingD
4646
// Configure the proxy settings, if applicable.
4747
if (this.proxy != null)
4848
{
49-
logger.LogDebug($"Configuring environment variables for the Registry proxy at {this.proxy.Address}");
49+
logger.LogDebug($"Configuring environment variables for the registry proxy at {this.proxy.Address}");
5050

5151
startInfo.EnvironmentVariables["HTTP_PROXY"] = this.proxy.Address;
5252
startInfo.EnvironmentVariables["HTTPS_PROXY"] = this.proxy.Address;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,17 @@ internal static class EnvironmentVariableNames
7575
public const string DiagnosticDir = "CODEQL_EXTRACTOR_CSHARP_DIAGNOSTIC_DIR";
7676

7777
/// <summary>
78-
/// Specifies the hostname of the Registry proxy.
78+
/// Specifies the hostname of the registry proxy.
7979
/// </summary>
8080
public const string ProxyHost = "CODEQL_PROXY_HOST";
8181

8282
/// <summary>
83-
/// Specifies the port of the Registry proxy.
83+
/// Specifies the port of the registry proxy.
8484
/// </summary>
8585
public const string ProxyPort = "CODEQL_PROXY_PORT";
8686

8787
/// <summary>
88-
/// Contains the certificate used by the Registry proxy.
88+
/// Contains the certificate used by the registry proxy.
8989
/// </summary>
9090
public const string ProxyCertificate = "CODEQL_PROXY_CA_CERTIFICATE";
9191

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public bool IsFeedReachable(string feed, int timeoutMilliSeconds, int tryCount)
4343
{
4444
logger.LogInfo($"Checking if NuGet feed '{feed}' is reachable...");
4545

46-
// Configure the HttpClient to be aware of the Registry proxy, if used.
46+
// Configure the HttpClient to be aware of the registry proxy, if used.
4747
HttpClientHandler httpClientHandler = new();
4848
if (registryProxy != null)
4949
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
77
public interface IRegistryProxy : IDisposable
88
{
99
/// <summary>
10-
/// The full address of the Registry proxy, if available.
10+
/// The full address of the registry proxy, if available.
1111
/// </summary>
1212
string Address { get; }
1313

@@ -27,7 +27,7 @@ public interface IRegistryProxy : IDisposable
2727
string? CertificatePath { get; }
2828

2929
/// <summary>
30-
/// The certificate used for the Registry proxy.
30+
/// The certificate used for the registry proxy.
3131
/// </summary>
3232
X509Certificate2? Certificate { get; }
3333
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
44
{
55
public interface IRegistryProxyConfiguration
66
{
7-
// The host of the Registry proxy, if available.
7+
// The host of the registry proxy, if available.
88
string? Host { get; }
99

10-
// The port of the Registry proxy, if available.
10+
// The port of the registry proxy, if available.
1111
string? Port { get; }
1212

13-
// The certificate of the Registry proxy, if available.
13+
// The certificate of the registry proxy, if available.
1414
string? Certificate { get; }
1515

16-
// The list of package registries that are configured for the Registry proxy, if any.
16+
// The list of package registries that are configured for the registry proxy, if any.
1717
// The value of the environment variable should be a JSON array of objects, such as:
1818
// [ { "type": "nuget_feed", "url": "https://nuget.pkg.github.com/org/index.json" } ]
1919
string? RegistryURLs { get; }

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private RegistryProxy(IRegistryProxyConfiguration config, ILogger logger, Tempor
8181
writer.Write(config.Certificate);
8282
writer.Close();
8383

84-
logger.LogInfo($"Stored Registry proxy certificate at {CertificatePath}");
84+
logger.LogInfo($"Stored registry proxy certificate at {CertificatePath}");
8585

8686
Certificate = X509Certificate2.CreateFromPem(config.Certificate);
8787
}
@@ -130,7 +130,7 @@ private RegistryProxy(IRegistryProxyConfiguration config, ILogger logger, Tempor
130130
internal static IRegistryProxy? Make(ILogger logger, IDiagnosticsWriter diagnosticsWriter, TemporaryDirectory tempWorkingDirectory)
131131
{
132132
// Setting HTTP(S)_PROXY and SSL_CERT_FILE have no effect on Windows or macOS,
133-
// but we would still end up using the Registry proxy to check for feed reachability.
133+
// but we would still end up using the registry proxy to check for feed reachability.
134134
// This would result in us discovering that the feeds are reachable, but `dotnet` would
135135
// fail to connect to them. To prevent this from happening, we do not initialise an
136136
// instance of `RegistryProxy` on those platforms.
@@ -143,7 +143,7 @@ private RegistryProxy(IRegistryProxyConfiguration config, ILogger logger, Tempor
143143
}
144144

145145
/// <summary>
146-
/// Creates an instance of the Registry proxy using the specified configuration.
146+
/// Creates an instance of the registry proxy using the specified configuration.
147147
/// Returns null if the proxy cannot be created.
148148
/// This overload is exposed primarily to enable platform-independent unit testing.
149149
/// </summary>
@@ -152,7 +152,7 @@ private RegistryProxy(IRegistryProxyConfiguration config, ILogger logger, Tempor
152152
{
153153
if (string.IsNullOrWhiteSpace(proxyConfig.Host) || string.IsNullOrWhiteSpace(proxyConfig.Port))
154154
{
155-
logger.LogDebug("No Registry proxy credentials are configured.");
155+
logger.LogDebug("No registry proxy credentials are configured.");
156156
return null;
157157
}
158158

csharp/extractor/Semmle.Extraction.Tests/RegistryProxy.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ private static TemporaryDirectory MakeTemporaryDirectory()
2929
}
3030

3131
/// <summary>
32-
/// Verify that the Registry proxy correctly handles the case where the port is not specified.
33-
/// In this case, the Registry proxy should not be created.
32+
/// Verify that the registry proxy correctly handles the case where the port is not specified.
33+
/// In this case, the registry proxy should not be created.
3434
/// </summary>
3535
[Fact]
3636
public void TestRegistryProxyNoPort()
@@ -51,8 +51,8 @@ public void TestRegistryProxyNoPort()
5151
}
5252

5353
/// <summary>
54-
/// Verify that the Registry proxy correctly handles the case where the host is not specified.
55-
/// In this case, the Registry proxy should not be created.
54+
/// Verify that the registry proxy correctly handles the case where the host is not specified.
55+
/// In this case, the registry proxy should not be created.
5656
/// </summary>
5757
[Fact]
5858
public void TestRegistryProxyNoHost()
@@ -105,7 +105,7 @@ public void TestRegistryProxyNoHost()
105105
""";
106106

107107
/// <summary>
108-
/// Verify that the Registry proxy correctly handles the case
108+
/// Verify that the registry proxy correctly handles the case
109109
/// where the port, host, and certificate are specified.
110110
/// </summary>
111111
[Fact]
@@ -131,9 +131,9 @@ public void TestRegistryProxyCertificate()
131131
}
132132

133133
/// <summary>
134-
/// Verify that the Registry proxy correctly handles the case where the RegistryURLs environment variable
134+
/// Verify that the registry proxy correctly handles the case where the RegistryURLs environment variable
135135
/// is not a valid JSON list.
136-
/// In this case, the Registry proxy should be created, but the list of private registries should be empty.
136+
/// In this case, the registry proxy should be created, but the list of private registries should be empty.
137137
/// </summary>
138138
[Fact]
139139
public void TestRegistryProxyUrlsParseError()
@@ -157,9 +157,9 @@ public void TestRegistryProxyUrlsParseError()
157157
}
158158

159159
/// <summary>
160-
/// Verify that the Registry proxy correctly handles the case where the RegistryURLs environment variable
160+
/// Verify that the registry proxy correctly handles the case where the RegistryURLs environment variable
161161
/// is a valid JSON list with a single entry.
162-
/// In this case, the Registry proxy should be created, and the list of private registries should contain the single entry.
162+
/// In this case, the registry proxy should be created, and the list of private registries should contain the single entry.
163163
/// </summary>
164164
[Fact]
165165
public void TestRegistryProxyUrlsSingle()
@@ -185,10 +185,10 @@ public void TestRegistryProxyUrlsSingle()
185185
}
186186

187187
/// <summary>
188-
/// Verify that the Registry proxy correctly handles the case where the RegistryURLs environment variable
188+
/// Verify that the registry proxy correctly handles the case where the RegistryURLs environment variable
189189
/// is a valid JSON list with multiple entries, but only one of them is of type "nuget_feed", which is
190190
/// relevant for C#.
191-
/// In this case, the Registry proxy should be created, and the list of private registries should
191+
/// In this case, the registry proxy should be created, and the list of private registries should
192192
/// contain only the entry of type "nuget_feed".
193193
/// </summary>
194194
[Fact]
@@ -215,9 +215,9 @@ public void TestRegistryProxyUrls3()
215215
}
216216

217217
/// <summary>
218-
/// Verify that the Registry proxy correctly handles the case where the RegistryURLs environment variable
218+
/// Verify that the registry proxy correctly handles the case where the RegistryURLs environment variable
219219
/// is a valid JSON list with multiple entries and one of them is configured to replace the base feeds.
220-
/// In this case, the Registry proxy should be created, and the list of private registries should contain all
220+
/// In this case, the registry proxy should be created, and the list of private registries should contain all
221221
/// entries, while the list of base registries should contain only the entry that replaces the base feeds.
222222
/// </summary>
223223
[Fact]

0 commit comments

Comments
 (0)