Skip to content

Commit 9898dfc

Browse files
committed
Update deps and add net10 to target frameworks
1 parent 5b9bfc6 commit 9898dfc

11 files changed

Lines changed: 63 additions & 75 deletions

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 3.0.3 (2025-11-14)
4+
5+
### Enhancements
6+
7+
- Add `net10.0` to target frameworks
8+
- Update dependencies
9+
310
## 3.0.2 (2025-10-12)
411

512
### Enhancements

Directory.Packages.props

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
<Project>
2-
<PropertyGroup>
3-
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4-
</PropertyGroup>
5-
<ItemGroup>
6-
<PackageVersion Include="NuGet.Protocol" Version="6.14.0" />
7-
<PackageVersion Include="NuGet.Versioning" Version="6.14.0" />
8-
<PackageVersion Include="Spectre.Console" Version="0.51.1" />
9-
<PackageVersion Include="Spectre.Console.Cli" Version="0.51.1" />
10-
11-
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
12-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
13-
<PackageVersion Include="Spectre.Console.Testing" Version="0.51.1" />
14-
<PackageVersion Include="Verify.Xunit" Version="30.12.0" />
15-
<PackageVersion Include="xunit" Version="2.9.3" />
16-
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.4" />
17-
</ItemGroup>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
7+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
8+
<PackageVersion Include="NuGet.Protocol" Version="7.0.0" />
9+
<PackageVersion Include="NuGet.Versioning" Version="7.0.0" />
10+
<PackageVersion Include="Spectre.Console" Version="0.54.0" />
11+
<PackageVersion Include="Spectre.Console.Cli" Version="0.53.0" />
12+
<PackageVersion Include="Spectre.Console.Cli.Testing" Version="1.0.0-alpha.0.7" />
13+
<PackageVersion Include="Verify.Xunit" Version="31.7.1" />
14+
<PackageVersion Include="xunit" Version="2.9.3" />
15+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
16+
</ItemGroup>
1817
</Project>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "http://json.schemastore.org/global",
33
"sdk": {
4-
"version": "9.0.305",
4+
"version": "10.0.100",
55
"rollForward": "latestFeature"
66
}
77
}

src/Commands/CheckCommand.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
using PackCheck.Data;
33
using PackCheck.Exceptions;
44
using PackCheck.Services;
5+
using Spectre.Console;
56
using Spectre.Console.Cli;
6-
using System.Threading.Tasks;
77
using System;
88
using System.Collections.Generic;
99
using System.Linq;
1010
using System.Text.Json;
11-
using Spectre.Console;
11+
using System.Threading;
12+
using System.Threading.Tasks;
1213

1314
namespace PackCheck.Commands;
1415

@@ -23,7 +24,7 @@ public CheckCommand()
2324
_nuGetPackagesService = new NuGetPackagesService(_nuGetApiService);
2425
}
2526

26-
public override async Task<int> ExecuteAsync(CommandContext context, CheckSettings settings)
27+
public override async Task<int> ExecuteAsync(CommandContext context, CheckSettings settings, CancellationToken _cancellationToken)
2728
{
2829
await PackCheckService.CheckForNewPackCheckVersion(_nuGetApiService);
2930

src/Commands/UpgradeCommand.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System;
88
using System.Collections.Generic;
99
using System.Text.Json;
10+
using System.Threading;
1011
using System.Threading.Tasks;
1112

1213
namespace PackCheck.Commands;
@@ -15,7 +16,7 @@ public class UpgradeCommand : AsyncCommand<UpgradeSettings>
1516
{
1617
private readonly NuGetPackagesService _nuGetPackagesService = new(new NuGetApiService());
1718

18-
public override async Task<int> ExecuteAsync(CommandContext context, UpgradeSettings settings)
19+
public override async Task<int> ExecuteAsync(CommandContext context, UpgradeSettings settings, CancellationToken _cancellationToken)
1920
{
2021
Result? result = null;
2122

src/PackCheck.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
<PackAsTool>true</PackAsTool>
88
<PackageOutputPath>./nupkg</PackageOutputPath>
99
<RootNamespace>PackCheck</RootNamespace>
10-
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
10+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
1111
<ToolCommandName>packcheck</ToolCommandName>
1212
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
13-
<Version>3.0.2</Version>
13+
<Version>3.0.3</Version>
1414
</PropertyGroup>
1515

1616
<PropertyGroup Label="Package Information">
@@ -20,7 +20,7 @@
2020
<PackageIcon>icon.png</PackageIcon>
2121
<PackageId>PackCheck</PackageId>
2222
<PackageLicenseExpression>MIT</PackageLicenseExpression>
23-
<PackageVersion>3.0.2</PackageVersion>
23+
<PackageVersion>3.0.3</PackageVersion>
2424
<RepositoryType>git</RepositoryType>
2525
<RepositoryUrl>https://github.com/eisnstein/PackCheck</RepositoryUrl>
2626
<PackageReadmeFile>README.md</PackageReadmeFile>

src/semver.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.1
1+
3.0.3

tests/Commands/CheckCommandTests.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using PackCheck.Commands;
2-
using Spectre.Console.Cli;
3-
using Spectre.Console.Testing;
2+
using Spectre.Console.Cli.Testing;
43
using VerifyXunit;
54

65
namespace PackCheck.Tests.Commands;
@@ -15,7 +14,6 @@ public void Returns_Success_ForCheck()
1514
var app = new CommandAppTester();
1615
app.Configure(config =>
1716
{
18-
config.PropagateExceptions();
1917
config.AddCommand<CheckCommand>("check");
2018
});
2119

@@ -34,11 +32,10 @@ public void Returns_Success_ForCheckWithFilter()
3432
var app = new CommandAppTester();
3533
app.Configure(config =>
3634
{
37-
config.PropagateExceptions();
38-
config.AddCommand<UpgradeCommand>("check");
35+
config.AddCommand<CheckCommand>("check");
3936
});
4037

41-
CommandAppResult result = app.Run(new[] { "check", "--filter", "Spectre.Console" });
38+
CommandAppResult result = app.Run(["check", "--filter", "Spectre.Console"]);
4239

4340
Verifier.Verify(result);
4441

tests/Commands/Settings/CheckSettingsTests.cs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using PackCheck.Commands.Settings;
33
using PackCheck.Services;
44
using Spectre.Console.Cli;
5-
using Spectre.Console.Testing;
5+
using Spectre.Console.Cli.Testing;
66

77
namespace PackCheck.Tests.Commands.Settings;
88

@@ -14,11 +14,10 @@ public void PathToCsProjFileIsNotSet()
1414
var app = new CommandAppTester();
1515
app.Configure(config =>
1616
{
17-
config.PropagateExceptions();
1817
config.AddCommand<CheckCommand>("check");
1918
});
2019

21-
CommandAppResult result = app.Run(new[] { "check" });
20+
CommandAppResult result = app.Run(["check"]);
2221

2322
Assert.NotNull(result.Settings);
2423
Assert.IsType<CheckSettings>(result.Settings);
@@ -35,7 +34,7 @@ public void PathToCsProjFileIsSetButNoValueGiven()
3534
config.AddCommand<CheckCommand>("check");
3635
});
3736

38-
CommandAppResult result = app.Run(new[] { "check", "--csprojFile" });
37+
CommandAppResult result = app.Run(["check", "--csprojFile"]);
3938

4039
Assert.Equal(-1, result.ExitCode);
4140
Assert.StartsWith(
@@ -50,10 +49,11 @@ public void PathToCsProjFileIsSet()
5049
var app = new CommandAppTester();
5150
app.Configure(config =>
5251
{
52+
config.PropagateExceptions();
5353
config.AddCommand<CheckCommand>("check");
5454
});
5555

56-
CommandAppResult result = app.Run(new[] { "check", "--csprojFile", @".\example.csproj" });
56+
CommandAppResult result = app.Run(["check", "--csprojFile", @".\example.csproj"]);
5757

5858
Assert.NotNull(result.Settings);
5959
Assert.IsType<CheckSettings>(result.Settings);
@@ -71,7 +71,7 @@ public void PathToSolutionFileIsSetButNoValueGiven()
7171
config.AddCommand<CheckCommand>("check");
7272
});
7373

74-
CommandAppResult result = app.Run(new[] { "check", "--slnFile" });
74+
CommandAppResult result = app.Run(["check", "--slnFile"]);
7575

7676
Assert.Equal(-1, result.ExitCode);
7777
Assert.StartsWith(
@@ -86,11 +86,10 @@ public void PathToSlnFileIsSet()
8686
var app = new CommandAppTester();
8787
app.Configure(config =>
8888
{
89-
// config.PropagateExceptions();
9089
config.AddCommand<CheckCommand>("check");
9190
});
9291

93-
CommandAppResult result = app.Run(new[] { "check", "--slnFile", @".\example.sln" });
92+
CommandAppResult result = app.Run(["check", "--slnFile", @".\example.sln"]);
9493

9594
Assert.NotNull(result.Settings);
9695
Assert.IsType<CheckSettings>(result.Settings);
@@ -108,7 +107,7 @@ public void PathToSolutionXFileIsSetButNoValueGiven()
108107
config.AddCommand<CheckCommand>("check");
109108
});
110109

111-
CommandAppResult result = app.Run(new[] { "check", "--slnxFile" });
110+
CommandAppResult result = app.Run(["check", "--slnxFile"]);
112111

113112
Assert.Equal(-1, result.ExitCode);
114113
Assert.StartsWith(
@@ -123,11 +122,10 @@ public void PathToSolutionXFileIsSet()
123122
var app = new CommandAppTester();
124123
app.Configure(config =>
125124
{
126-
// config.PropagateExceptions();
127125
config.AddCommand<CheckCommand>("check");
128126
});
129127

130-
CommandAppResult result = app.Run(new[] { "check", "--slnxFile", @".\example.slnx" });
128+
CommandAppResult result = app.Run(["check", "--slnxFile", @".\example.slnx"]);
131129

132130
Assert.NotNull(result.Settings);
133131
Assert.IsType<CheckSettings>(result.Settings);
@@ -145,7 +143,7 @@ public void PathToCpmFileIsSetButNoValueGiven()
145143
config.AddCommand<CheckCommand>("check");
146144
});
147145

148-
CommandAppResult result = app.Run(new[] { "check", "--cpmFile" });
146+
CommandAppResult result = app.Run(["check", "--cpmFile"]);
149147

150148
// No Directory.Packages.props file is given
151149
Assert.Equal(-1, result.ExitCode);
@@ -278,6 +276,6 @@ public void Error_When_WrongFormatOptionIsGiven()
278276
config.AddCommand<CheckCommand>("check");
279277
});
280278

281-
Assert.Throws<CommandRuntimeException>(() => app.Run(new[] { "check", "--format", "wrong" }));
279+
Assert.Throws<CommandRuntimeException>(() => app.Run(["check", "--format", "wrong"]));
282280
}
283281
}

tests/Commands/Settings/UpgradeSettingsTests.cs

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using PackCheck.Commands;
22
using PackCheck.Commands.Settings;
33
using Spectre.Console.Cli;
4-
using Spectre.Console.Testing;
4+
using Spectre.Console.Cli.Testing;
55

66
namespace PackCheck.Tests.Commands.Settings;
77

@@ -13,11 +13,10 @@ public void DefaultTargetVersionIsSet()
1313
var app = new CommandAppTester();
1414
app.Configure(config =>
1515
{
16-
config.PropagateExceptions();
1716
config.AddCommand<UpgradeCommand>("upgrade");
1817
});
1918

20-
CommandAppResult result = app.Run(new[] { "upgrade" });
19+
CommandAppResult result = app.Run(["upgrade"]);
2120

2221
Assert.NotNull(result.Settings);
2322
Assert.IsType<UpgradeSettings>(result.Settings);
@@ -32,11 +31,10 @@ public void TargetVersionGetsSetToStable()
3231
var app = new CommandAppTester();
3332
app.Configure(config =>
3433
{
35-
config.PropagateExceptions();
3634
config.AddCommand<UpgradeCommand>("upgrade");
3735
});
3836

39-
CommandAppResult result = app.Run(new[] { "upgrade", "--target", "stable" });
37+
CommandAppResult result = app.Run(["upgrade", "--target", "stable"]);
4038

4139
Assert.NotNull(result.Settings);
4240
Assert.IsType<UpgradeSettings>(result.Settings);
@@ -51,11 +49,10 @@ public void TargetVersionGetsSetToLatest()
5149
var app = new CommandAppTester();
5250
app.Configure(config =>
5351
{
54-
config.PropagateExceptions();
5552
config.AddCommand<UpgradeCommand>("upgrade");
5653
});
5754

58-
CommandAppResult result = app.Run(new[] { "upgrade", "--target", "latest" });
55+
CommandAppResult result = app.Run(["upgrade", "--target", "latest"]);
5956

6057
Assert.NotNull(result.Settings);
6158
Assert.IsType<UpgradeSettings>(result.Settings);
@@ -74,7 +71,7 @@ public void ThrowsOnWrongTargetVersion()
7471
config.AddCommand<UpgradeCommand>("upgrade");
7572
});
7673

77-
Assert.Throws<CommandRuntimeException>(() => app.Run(new[] { "upgrade", "--target", "wrong" }));
74+
Assert.Throws<CommandRuntimeException>(() => app.Run(["upgrade", "--target", "wrong"]));
7875
}
7976

8077
[Fact]
@@ -83,14 +80,13 @@ public void AllArgumentsWithoutDryRunGetSet()
8380
var app = new CommandAppTester();
8481
app.Configure(config =>
8582
{
86-
config.PropagateExceptions();
8783
config.AddCommand<UpgradeCommand>("upgrade");
8884
});
8985

90-
CommandAppResult result = app.Run(new[]
91-
{
86+
CommandAppResult result = app.Run(
87+
[
9288
"upgrade", "awesome-package", "--csprojFile", "\\path-to-file", "--target", "latest"
93-
});
89+
]);
9490

9591
Assert.NotNull(result.Settings);
9692
Assert.IsType<UpgradeSettings>(result.Settings);
@@ -111,14 +107,13 @@ public void AllArgumentsWithDryRunGetSet()
111107
var app = new CommandAppTester();
112108
app.Configure(config =>
113109
{
114-
config.PropagateExceptions();
115110
config.AddCommand<UpgradeCommand>("upgrade");
116111
});
117112

118-
CommandAppResult result = app.Run(new[]
119-
{
113+
CommandAppResult result = app.Run(
114+
[
120115
"upgrade", "awesome-package", "--csprojFile", "\\path-to-file", "--target", "latest", "--dry-run"
121-
});
116+
]);
122117

123118
Assert.NotNull(result.Settings);
124119
Assert.IsType<UpgradeSettings>(result.Settings);
@@ -139,14 +134,10 @@ public void InteractiveIsNotSet()
139134
var app = new CommandAppTester();
140135
app.Configure(config =>
141136
{
142-
config.PropagateExceptions();
143137
config.AddCommand<UpgradeCommand>("upgrade");
144138
});
145139

146-
CommandAppResult result = app.Run(new[]
147-
{
148-
"upgrade"
149-
});
140+
CommandAppResult result = app.Run(["upgrade"]);
150141

151142
Assert.NotNull(result.Settings);
152143
Assert.IsType<UpgradeSettings>(result.Settings);
@@ -163,10 +154,7 @@ public void InteractiveIsSetByShortCode()
163154
config.AddCommand<UpgradeCommand>("upgrade");
164155
});
165156

166-
CommandAppResult result = app.Run(new[]
167-
{
168-
"upgrade", "-i"
169-
});
157+
CommandAppResult result = app.Run(["upgrade", "-i"]);
170158

171159
Assert.NotNull(result.Settings);
172160
Assert.IsType<UpgradeSettings>(result.Settings);
@@ -183,10 +171,7 @@ public void InteractiveIsSetByLongCode()
183171
config.AddCommand<UpgradeCommand>("upgrade");
184172
});
185173

186-
CommandAppResult result = app.Run(new[]
187-
{
188-
"upgrade", "--interactive"
189-
});
174+
CommandAppResult result = app.Run(["upgrade", "--interactive"]);
190175

191176
Assert.NotNull(result.Settings);
192177
Assert.IsType<UpgradeSettings>(result.Settings);

0 commit comments

Comments
 (0)