Upgrade to .NET 10.0 and update dependencies across the solution; ref…#37
Upgrade to .NET 10.0 and update dependencies across the solution; ref…#37HowardvanRooijen merged 3 commits intomainfrom
Conversation
…actor integration tests and CLI commands to accommodate framework changes; remove obsolete solution file; enhance README with updated usage instructions for .NET 10.0.
|
Also addresses #36 |
There was a problem hiding this comment.
Pull request overview
This PR upgrades the DeadCode solution to .NET 10, refreshes key NuGet dependencies (notably Spectre.Console + CLI/test libs), and updates build/test tooling and documentation to match the new target framework and solution layout.
Changes:
- Migrate projects and docs from
net9.0tonet10.0, and update CI to use the .NET 10 SDK. - Update Spectre.Console(-Cli) usage, including command execution signatures and DI wiring via the custom
TypeRegistrar. - Replace the legacy
.slnwith a.slnxand align build configuration/scripts accordingly.
Reviewed changes
Copilot reviewed 27 out of 29 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| build.ps1 | Keeps the PowerShell build entrypoint aligned with updated repo formatting/tooling. |
| .zf/config.ps1 | Switches build configuration to use Solutions/DeadCode.slnx. |
| .github/workflows/build.yml | Updates CI to run with .NET SDK 10.x. |
| Solutions/DeadCode.slnx | Adds the new XML-based solution definition. |
| Solutions/DeadCode.sln | Removes the legacy Visual Studio solution file. |
| Solutions/demo.ps1 | Updates demo script paths to net10.0 outputs. |
| Solutions/DeadCode/DeadCode.csproj | Moves tool to net10.0 and bumps runtime dependencies. |
| Solutions/DeadCode/Program.cs | Adjusts Spectre.Console.Cli DI integration (defer BuildServiceProvider). |
| Solutions/DeadCode/CLI/Commands/ExtractCommand.cs | Updates command execution signature to include cancellation. |
| Solutions/DeadCode/CLI/Commands/ProfileCommand.cs | Updates command execution signature to include cancellation. |
| Solutions/DeadCode/CLI/Commands/AnalyzeCommand.cs | Updates command execution signature to include cancellation. |
| Solutions/DeadCode/CLI/Commands/FullCommand.cs | Updates command execution signature and forwards cancellation to subcommands. |
| Solutions/DeadCode/README.md | Updates usage examples and requirements to .NET 10 / net10.0. |
| README.md | Updates root documentation examples/requirements to .NET 10 / net10.0. |
| Solutions/Samples/SampleAppWithDeadCode/SampleAppWithDeadCode.csproj | Moves sample app to net10.0. |
| Solutions/DeadCode.Tests/DeadCode.Tests.csproj | Moves tests to net10.0 and bumps test/dependency packages. |
| Solutions/DeadCode.Tests/TestFixtures/SampleConsoleApp/SampleConsoleApp.csproj | Moves fixture app to net10.0. |
| Solutions/DeadCode.Tests/TestFixtures/SampleAsyncApp/SampleAsyncApp.csproj | Moves fixture app to net10.0. |
| Solutions/DeadCode.Tests/TestFixtures/SampleInheritanceApp/SampleInheritanceApp.csproj | Moves fixture app to net10.0. |
| Solutions/DeadCode.Tests/Integration/ReflectionMethodScannerIntegrationTests.cs | Updates fixture assembly paths to net10.0. |
| Solutions/DeadCode.Tests/Integration/DeadCodeDetectionIntegrationTests.cs | Updates sample app path to net10.0. |
| Solutions/DeadCode.Tests/Integration/ProgramIntegrationTests.cs | Updates TypeRegistrar test to match new ctor signature. |
| Solutions/DeadCode.Tests/CLI/Infrastructure/TypeRegistrarTests.cs | Updates tests to match new TypeRegistrar behavior and adds resolvability assertions. |
| Solutions/DeadCode.Tests/CLI/Commands/ProfileCommandTests.cs | Updates test calls to include CancellationToken. |
| Solutions/DeadCode.Tests/CLI/Commands/FullCommandTests.cs | Updates mocks/calls to include CancellationToken. |
| Solutions/DeadCode.Tests/CLI/Commands/ExtractCommandTests.cs | Updates test calls to include CancellationToken. |
| Solutions/DeadCode.Tests/CLI/Commands/AnalyzeCommandTests.cs | Updates test calls to include CancellationToken. |
| .gitignore | Adds ignores for additional local/dev directories. |
| .gitattributes | Introduces line-ending normalization rules across the repo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public override async Task<int> ExecuteAsync(CommandContext context, Settings settings, CancellationToken cancellation) | ||
| { | ||
| logger.LogInformation("Starting profiling session"); |
There was a problem hiding this comment.
CancellationToken cancellation is currently ignored. Profiling scenarios and trace collection can take a long time, so the command should observe cancellation (e.g., check cancellation.ThrowIfCancellationRequested() between scenarios) and pass it to cancellable I/O like File.ReadAllTextAsync when loading scenarios.
| public override async Task<int> ExecuteAsync(CommandContext context, Settings settings, CancellationToken cancellation) | ||
| { | ||
| logger.LogInformation("Starting redundancy analysis"); |
There was a problem hiding this comment.
The added CancellationToken cancellation parameter isn’t used, so trace parsing/analysis can’t be cancelled once started. Consider threading cancellation through file reads (e.g., File.ReadAllTextAsync) and checking it inside the trace parsing loop to abort promptly.
| public override async Task<int> ExecuteAsync(CommandContext context, Settings settings, CancellationToken cancellation) | ||
| { | ||
| logger.LogInformation("Starting full deadcode analysis pipeline"); | ||
|
|
There was a problem hiding this comment.
CancellationToken cancellation is forwarded to sub-commands, but this method doesn’t check it between steps. Consider calling cancellation.ThrowIfCancellationRequested() before/after each pipeline stage so a cancel request doesn’t continue executing subsequent steps.
| public override async Task<int> ExecuteAsync(CommandContext context, Settings settings, CancellationToken cancellation) | ||
| { |
There was a problem hiding this comment.
The new CancellationToken cancellation parameter isn’t used, so cancellation (e.g., Ctrl+C) won’t stop long-running extraction or the file write. Consider passing cancellation into cancellable operations (e.g., File.WriteAllTextAsync) and checking/throwing cancellation inside the progress loop so the command can abort promptly.
…ntory and RedundancyReport to use cached methods; enhance JSON serialization options; remove obsolete test helpers and project settings for .NET 10.0
…nds; update inventory loading and saving methods to accept CancellationToken
Code Coverage Summary Report - Linux (No TFM)Summary
CoverageDeadCode - 78.7%
DeadCode.Tests - 95.7%
|
…actor integration tests and CLI commands to accommodate framework changes; remove obsolete solution file; enhance README with updated usage instructions for .NET 10.0.