Skip to content

Commit 6c0afab

Browse files
committed
C#: Rename DotnetVersion to DotNetVersion.
1 parent 31327f4 commit 6c0afab

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotnetVersion.cs renamed to csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNetVersion.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Semmle.Extraction.CSharp.DependencyFetching
55
{
6-
internal record DotnetVersion : IComparable<DotnetVersion>
6+
internal record DotNetVersion : IComparable<DotNetVersion>
77
{
88
private readonly string dir;
99
private readonly Version version;
@@ -48,7 +48,7 @@ public string? FullPathReferenceAssemblies
4848
}
4949

5050

51-
public DotnetVersion(string dir, string version, string preReleaseVersionType, string preReleaseVersion)
51+
public DotNetVersion(string dir, string version, string preReleaseVersionType, string preReleaseVersion)
5252
{
5353
this.dir = dir;
5454
this.version = Version.Parse(version);
@@ -59,7 +59,7 @@ public DotnetVersion(string dir, string version, string preReleaseVersionType, s
5959
}
6060
}
6161

62-
public int CompareTo(DotnetVersion? other)
62+
public int CompareTo(DotNetVersion? other)
6363
{
6464
var c = version.CompareTo(other?.version);
6565
if (c == 0 && IsPreRelease)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
88
{
99
internal class Razor
1010
{
11-
private readonly DotnetVersion sdk;
11+
private readonly DotNetVersion sdk;
1212
private readonly ProgressMonitor progressMonitor;
1313
private readonly IDotNet dotNet;
1414
private readonly string sourceGeneratorFolder;
1515
private readonly string cscPath;
1616

17-
public Razor(DotnetVersion sdk, IDotNet dotNet, ProgressMonitor progressMonitor)
17+
public Razor(DotNetVersion sdk, IDotNet dotNet, ProgressMonitor progressMonitor)
1818
{
1919
this.sdk = sdk;
2020
this.progressMonitor = progressMonitor;

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ internal partial class Runtime
1717
private const string aspNetCoreApp = "Microsoft.AspNetCore.App";
1818

1919
private readonly IDotNet dotNet;
20-
private readonly Lazy<Dictionary<string, DotnetVersion>> newestRuntimes;
21-
private Dictionary<string, DotnetVersion> NewestRuntimes => newestRuntimes.Value;
20+
private readonly Lazy<Dictionary<string, DotNetVersion>> newestRuntimes;
21+
private Dictionary<string, DotNetVersion> NewestRuntimes => newestRuntimes.Value;
2222
private static string ExecutingRuntime => RuntimeEnvironment.GetRuntimeDirectory();
2323

2424
public Runtime(IDotNet dotNet)
@@ -36,17 +36,17 @@ public Runtime(IDotNet dotNet)
3636
/// It is assume that the format of a listed runtime is something like:
3737
/// Microsoft.NETCore.App 7.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
3838
/// </summary>
39-
private static Dictionary<string, DotnetVersion> ParseRuntimes(IList<string> listed)
39+
private static Dictionary<string, DotNetVersion> ParseRuntimes(IList<string> listed)
4040
{
4141
// Parse listed runtimes.
42-
var runtimes = new Dictionary<string, DotnetVersion>();
42+
var runtimes = new Dictionary<string, DotNetVersion>();
4343
var regex = RuntimeRegex();
4444
listed.ForEach(r =>
4545
{
4646
var match = regex.Match(r);
4747
if (match.Success)
4848
{
49-
runtimes.AddOrUpdateToLatest(match.Groups[1].Value, new DotnetVersion(match.Groups[6].Value, match.Groups[2].Value, match.Groups[4].Value, match.Groups[5].Value));
49+
runtimes.AddOrUpdateToLatest(match.Groups[1].Value, new DotNetVersion(match.Groups[6].Value, match.Groups[2].Value, match.Groups[4].Value, match.Groups[5].Value));
5050
}
5151
});
5252

@@ -56,7 +56,7 @@ private static Dictionary<string, DotnetVersion> ParseRuntimes(IList<string> lis
5656
/// <summary>
5757
/// Returns a dictionary mapping runtimes to their newest version.
5858
/// </summary>
59-
internal Dictionary<string, DotnetVersion> GetNewestRuntimes()
59+
internal Dictionary<string, DotNetVersion> GetNewestRuntimes()
6060
{
6161
var listed = dotNet.GetListedRuntimes();
6262
return ParseRuntimes(listed);

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ internal partial class Sdk
1414
[GeneratedRegex(@"^(\d+\.\d+\.\d+)(-([a-z]+)\.(\d+\.\d+\.\d+))?\s\[(.+)\]$")]
1515
private static partial Regex SdkRegex();
1616

17-
private static HashSet<DotnetVersion> ParseSdks(IList<string> listed)
17+
private static HashSet<DotNetVersion> ParseSdks(IList<string> listed)
1818
{
19-
var sdks = new HashSet<DotnetVersion>();
19+
var sdks = new HashSet<DotNetVersion>();
2020
var regex = SdkRegex();
2121
listed.ForEach(r =>
2222
{
2323
var match = regex.Match(r);
2424
if (match.Success)
2525
{
26-
sdks.Add(new DotnetVersion(match.Groups[5].Value, match.Groups[1].Value, match.Groups[3].Value, match.Groups[4].Value));
26+
sdks.Add(new DotNetVersion(match.Groups[5].Value, match.Groups[1].Value, match.Groups[3].Value, match.Groups[4].Value));
2727
}
2828
});
2929

3030
return sdks;
3131
}
3232

33-
public DotnetVersion? GetNewestSdk()
33+
public DotNetVersion? GetNewestSdk()
3434
{
3535
var listed = dotNet.GetListedSdks();
3636
var sdks = ParseSdks(listed);

0 commit comments

Comments
 (0)