Skip to content

Commit 4847af9

Browse files
committed
make cls compliant
1 parent ec05147 commit 4847af9

8 files changed

Lines changed: 22 additions & 9 deletions

File tree

src/DiffEngine.Tests/DiffEngine.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<PackageReference Include="Xunit" Version="2.4.1" />
1717
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
1818
<PackageReference Include="ProjectDefaults" Version="1.0.42" PrivateAssets="All" />
19-
<PackageReference Include="XunitContext" Version="1.9.1" />
19+
<PackageReference Include="XunitContext" Version="1.9.2" />
2020
<ProjectReference Include="..\DiffEngine\DiffEngine.csproj" />
2121
</ItemGroup>
2222
</Project>

src/DiffEngine/ClsCompliant.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
using System;
2+
3+
[assembly:CLSCompliant(true)]

src/DiffEngine/DiffEngine.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<TargetFrameworks>netstandard2.0;netstandard2.1;net461</TargetFrameworks>
77
</PropertyGroup>
88
<ItemGroup>
9-
<PackageReference Include="EmptyFiles" Version="2.0.0" PrivateAssets="None" />
9+
<PackageReference Include="EmptyFiles" Version="2.0.1" PrivateAssets="None" />
1010
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" Condition="$(Configuration) == 'Release'" />
1111
<PackageReference Include="ProjectDefaults" Version="1.0.42" PrivateAssets="All" />
1212
<PackageReference Include="Nullable" Version="1.2.1" PrivateAssets="All" />

src/DiffEngine/DiffRunner.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ namespace DiffEngine
1010
/// </summary>
1111
public static class DiffRunner
1212
{
13-
static uint maxInstancesToLaunch = 5;
14-
static uint launchedInstances;
15-
public static void MaxInstancesToLaunch(uint value)
13+
static int maxInstancesToLaunch = 5;
14+
static int launchedInstances;
15+
16+
public static void MaxInstancesToLaunch(int value)
1617
{
18+
Guard.AgainstNegativeAndZero(value, nameof(value));
1719
maxInstancesToLaunch = value;
1820
}
1921

src/DiffEngine/Guard.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ public static void AgainstNull(object? value, string argumentName)
1313
}
1414
}
1515

16+
public static void AgainstNegativeAndZero(int value, string argumentName)
17+
{
18+
if (value <= 0)
19+
{
20+
throw new ArgumentOutOfRangeException(argumentName);
21+
}
22+
}
23+
1624
public static void FileExists(string path, string argumentName)
1725
{
1826
AgainstNullOrEmpty(argumentName, path);

src/DiffEngine/ProcessCleanup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ from Win32_Process
8686
foreach (var process in collection)
8787
{
8888
var command = (string) process["CommandLine"];
89-
var id = (uint) process["ProcessId"];
89+
var id = (int) process["ProcessId"];
9090
process.Dispose();
9191
yield return new ProcessCommand(command, id);
9292
}

src/DiffEngine/ProcessCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ public class ProcessCommand
1313
/// <summary>
1414
/// The process Id.
1515
/// </summary>
16-
public uint Process { get; }
16+
public int Process { get; }
1717

18-
public ProcessCommand(string command, in uint process)
18+
public ProcessCommand(string command, in int process)
1919
{
2020
Guard.AgainstNullOrEmpty(command, nameof(command));
2121
Command = command;

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project>
33
<PropertyGroup>
44
<NoWarn>CS1591;CS0649</NoWarn>
5-
<Version>2.0.2</Version>
5+
<Version>2.0.3</Version>
66
<AssemblyVersion>1.0.0.0</AssemblyVersion>
77
<PackageTags>Json, Testing, Verify, Snapshot, Approvals</PackageTags>
88
<Description>Enables simple verification of complex models and documents.</Description>

0 commit comments

Comments
 (0)