From 97f2d85b7aa6ffcd148b936803c3526545c97f99 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Sat, 11 Jul 2026 20:38:35 -0700 Subject: [PATCH] conformance: xUnit v3 test migration, config hygiene, --pull=always lint tasks Fleet CODESTYLE conformance sweep against the LanguageTags/PlexCleaner reference repos. Issue #380 (a) - tests on xUnit v3: - Directory.Packages.props: replace legacy xunit 2.9.3 with xunit.v3 3.2.2 (matching the fleet). - UtilitiesTests.csproj: set IsTestProject=true and align package refs to the PlexCleanerTests standard (xunit.v3, drop the packaging metadata, SourceLink, and the now-transitive Logging.Abstractions ref). Tests already use AwesomeAssertions .Should(); no assert conversion needed. Issue #380 (b) - library logging via ILoggerFactory - already landed in an earlier commit (LogOptions seam + Sandbox SerilogLoggerFactory bridge); closing it here as the xUnit half completes the issue. Issue #387 - project config hygiene: - Remove the stale CA2007 suppression from UtilitiesTests/.editorconfig; it is absent from the reference repos and the project builds warnings-clean without it on xunit.v3. Remaining suppressions (CA1707/CA1515 in tests, CA1711 in the library) are each verified still-needed and comment-justified. - No inline #pragma warning disable present; GlobalUsings.cs present in every project; no stale GitHub Packages source in nuget/props - already conformant. --pull=always: add "--pull=always" after "--rm" in each docker Lint task in .vscode/tasks.json so on-demand lint always pulls the :latest image. Closes #380 Closes #387 Co-Authored-By: Claude Opus 4.8 (1M context) --- .vscode/tasks.json | 8 ++++---- Directory.Packages.props | 2 +- UtilitiesTests/.editorconfig | 3 --- UtilitiesTests/UtilitiesTests.csproj | 20 ++------------------ 4 files changed, 7 insertions(+), 26 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 3b233ea..5eee7e9 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -139,7 +139,7 @@ "label": "Lint: EditorConfig", "type": "process", "command": "docker", - "args": [ "run", "--rm", "-v", "${workspaceFolder}:/check", "-w", "/check", "mstruebing/editorconfig-checker:latest" ], + "args": [ "run", "--rm", "--pull=always", "-v", "${workspaceFolder}:/check", "-w", "/check", "mstruebing/editorconfig-checker:latest" ], "problemMatcher": [], "presentation": { "showReuseMessage": false, @@ -150,7 +150,7 @@ "label": "Lint: Workflows", "type": "process", "command": "docker", - "args": [ "run", "--rm", "-v", "${workspaceFolder}:/repo", "-w", "/repo", "rhysd/actionlint:latest", "-color" ], + "args": [ "run", "--rm", "--pull=always", "-v", "${workspaceFolder}:/repo", "-w", "/repo", "rhysd/actionlint:latest", "-color" ], "problemMatcher": [], "presentation": { "showReuseMessage": false, @@ -161,7 +161,7 @@ "label": "Lint: Markdown", "type": "process", "command": "docker", - "args": [ "run", "--rm", "-v", "${workspaceFolder}:/workdir", "-w", "/workdir", "davidanson/markdownlint-cli2:latest", "**/*.md" ], + "args": [ "run", "--rm", "--pull=always", "-v", "${workspaceFolder}:/workdir", "-w", "/workdir", "davidanson/markdownlint-cli2:latest", "**/*.md" ], "problemMatcher": [], "presentation": { "showReuseMessage": false, @@ -172,7 +172,7 @@ "label": "Lint: Spelling", "type": "process", "command": "docker", - "args": [ "run", "--rm", "-v", "${workspaceFolder}:/workdir", "-w", "/workdir", "ghcr.io/streetsidesoftware/cspell:latest", "--no-progress", "README.md", "HISTORY.md" ], + "args": [ "run", "--rm", "--pull=always", "-v", "${workspaceFolder}:/workdir", "-w", "/workdir", "ghcr.io/streetsidesoftware/cspell:latest", "--no-progress", "README.md", "HISTORY.md" ], "problemMatcher": [], "presentation": { "showReuseMessage": false, diff --git a/Directory.Packages.props b/Directory.Packages.props index de12f18..fdfbc51 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -9,8 +9,8 @@ - + diff --git a/UtilitiesTests/.editorconfig b/UtilitiesTests/.editorconfig index f443e5e..1bb70bb 100644 --- a/UtilitiesTests/.editorconfig +++ b/UtilitiesTests/.editorconfig @@ -8,6 +8,3 @@ dotnet_diagnostic.CA1707.severity = none # CA1515: xUnit discovers only public test classes, so they cannot be internal. dotnet_diagnostic.CA1515.severity = none - -# CA2007: xUnit forbids ConfigureAwait in test methods (xUnit1030), so CA2007 cannot be satisfied in test code. -dotnet_diagnostic.CA2007.severity = none diff --git a/UtilitiesTests/UtilitiesTests.csproj b/UtilitiesTests/UtilitiesTests.csproj index ab15043..6d87d47 100644 --- a/UtilitiesTests/UtilitiesTests.csproj +++ b/UtilitiesTests/UtilitiesTests.csproj @@ -1,28 +1,12 @@ - false - Pieter Viljoen - Pieter Viljoen - Pieter Viljoen - Generally useful utility classes - 1.1.0.1 - 1.1.0.1 - 1.1.0.0 - ptr727.Utilities.Tests - UtilitiesTests + true ptr727.Utilities.Tests - en - true - true - true - snupkg - - - + all runtime; build; native; contentfiles; analyzers; buildtransitive