') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); conformance: xUnit v3 migration, config hygiene, --pull=always lint tasks by ptr727 · Pull Request #403 · ptr727/Utilities · GitHub
Skip to content

conformance: xUnit v3 migration, config hygiene, --pull=always lint tasks - #403

Merged
ptr727 merged 1 commit into
developfrom
conformance/codestyle
Jul 12, 2026
Merged

conformance: xUnit v3 migration, config hygiene, --pull=always lint tasks#403
ptr727 merged 1 commit into
developfrom
conformance/codestyle

Conversation

@ptr727

Copy link
Copy Markdown
Owner

Fleet CODESTYLE conformance sweep against the LanguageTags / PlexCleaner reference repos. Three items bundled into one PR.

Issue #380 — xUnit v3 + AwesomeAssertions, ILoggerFactory logging

(a) Tests on xUnit v3.

  • Directory.Packages.props: replaced legacy xunit 2.9.3 with xunit.v3 3.2.2 (matching the fleet). The v3 toolchain packages (Microsoft.NET.Test.Sdk 18.7.0, coverlet.collector 10.0.1, xunit.analyzers 1.27.0, xunit.runner.visualstudio 3.1.5) and AwesomeAssertions 9.4.0 were already pinned.
  • UtilitiesTests/UtilitiesTests.csproj: set IsTestProject=true and aligned package references to the PlexCleanerTests standard — xunit.v3, dropped the packaging metadata (PackageId/Version/Authors/…), SourceLink, and the now-transitive Microsoft.Extensions.Logging.Abstractions reference.
  • The test suite already uses AwesomeAssertions .Should() throughout (no native Assert.* remained), so no assertion conversion was required.

(b) Library logging via ILoggerFactory. Already landed in an earlier commit on this branch — Utilities.csproj depends only on Microsoft.Extensions.Logging.Abstractions, LogOptions exposes the settable factory seam (SetFactory/TrySetFactory, defaulting to NullLoggerFactory), and Sandbox owns the concrete Serilog logger via SerilogLoggerFactory. Closing the issue here now that the xUnit half is complete.

Issue #387 — project config hygiene

  • Analyzer suppressions: removed the stale CA2007 suppression from UtilitiesTests/.editorconfig; it is absent from both reference repos and the project builds warnings-clean without it under xunit.v3. The remaining suppressions were each verified still-needed by removing-and-rebuilding: CA1707/CA1515 (test project) and CA1711 (library Ex-suffix types) — all comment-justified.
  • Inline pragmas: none present (grep for #pragma warning is empty).
  • GlobalUsings.cs: present in every project (Utilities, UtilitiesTests, Sandbox).
  • Stale package source: no GitHub Packages source exists in any nuget.config/Directory.*.props; restore is nuget.org only. Already conformant.

Fleet --pull=always

.vscode/tasks.json: inserted "--pull=always" immediately after "--rm" in each docker Lint task (editorconfig-checker, actionlint, markdownlint-cli2, cspell) so on-demand lint always pulls the :latest image. JSONC and CRLF preserved.

Validation

  • dotnet build (warnings-as-errors): 0 warnings, 0 errors.
  • dotnet test: 183 passed, 0 failed, 0 skipped.
  • editorconfig-checker (docker :latest): clean.
  • Line endings preserved per file (all edited files are CRLF; no normalization).

Closes#380
Closes#387

…int 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#380Closes#387
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings July 12, 2026 03:39
@codecov

codecovBot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.89%. Comparing base (f04d276) to head (97f2d85).

Additional details and impacted files
@@ Coverage Diff @@## develop #403 +/- ##
========================================
Coverage 66.89% 66.89% ========================================
Files 13 13 Lines 1160 1160 Branches 108 108 ========================================
Hits 776 776 Misses 338 338 Partials 46 46 

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR brings the Utilities repo into fleet CODESTYLE conformance by migrating the test project to xUnit v3, tightening test-project config hygiene, and ensuring VS Code Docker-based lint tasks always pull the latest images.

Changes:

  • Migrate UtilitiesTests from xunit v2 to xunit.v3 (central package pin + test project references), keeping the existing AwesomeAssertions-based assertions.
  • Remove a stale CA2007 suppression from the test project .editorconfig.
  • Update VS Code lint tasks to run Docker with --pull=always so :latest images are refreshed on demand.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

FileDescription
UtilitiesTests/UtilitiesTests.csprojMarks the project as a test project and aligns package references for xUnit v3-based test execution.
UtilitiesTests/.editorconfigRemoves a no-longer-needed analyzer suppression to keep suppressions minimal and justified.
Directory.Packages.propsDrops the legacy xUnit v2 pin and adds the xUnit v3 pin for central package management.
.vscode/tasks.jsonEnsures local Docker lint tasks always pull the latest images via --pull=always.

@ptr727
ptr727 merged commit 11dd689 into developJul 12, 2026
12 checks passed
@ptr727
ptr727 deleted the conformance/codestyle branch July 12, 2026 03:41
ptr727 added a commit that referenced this pull request Jul 12, 2026
…ays (#404)
Forward promotion of the accumulated conformance work (#401/#402/#403).
No release: this is a human merge, so the publish plan gates to
publish=false. No library source (`Utilities/**`) changed.
ptr727-codegenBot pushed a commit to ptr727/LanguageTags that referenced this pull request Jul 15, 2026
Updated
[Microsoft.Extensions.Logging.Abstractions](https://github.com/dotnet/dotnet)
from 10.0.9 to 10.0.10.
<details>
<summary>Release notes</summary>
_Sourced from [Microsoft.Extensions.Logging.Abstractions's
releases](https://github.com/dotnet/dotnet/releases)._
No release notes found for this version range.
Commits viewable in [compare
view](https://github.com/dotnet/dotnet/commits).
</details>
Updated [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest)
from 18.7.0 to 18.8.1.
<details>
<summary>Release notes</summary>
_Sourced from [Microsoft.NET.Test.Sdk's
releases](https://github.com/microsoft/vstest/releases)._
## 18.8.1
## What's Changed
* Fix protocol negotiation timeout when STJ reflection is disabled
(18.8.1) by @​nohwnd in microsoft/vstest#16281
**Full Changelog**:
microsoft/vstest@v18.8.0...v18.8.1
## 18.8.0
## What's Changed
* Migrate from Newtonsoft.Json to System.Text.Json / Jsonite (merge to
main) by @​nohwnd in microsoft/vstest#15687
- For more detail refer to
https://devblogs.microsoft.com/dotnet/vs-test-is-removing-its-newtonsoft-json-dependency/
* Create source-only filter package by @​Youssef1313 in
microsoft/vstest#15638
* Add ARM64 msdia140.dll support to test platform packages by @​nohwnd
in microsoft/vstest#15692
* Fix mutex cleanup crash on macOS/Linux by @​nohwnd in
microsoft/vstest#15684
* Restrict artifact temp directory permissions on Unix by @​nohwnd in
microsoft/vstest#15729
* Add support for filtering uncategorized tests with TestCategory=None
by @​Evangelink in microsoft/vstest#15727
* Fix SCI binding failure in DTA hosts (main) by @​nohwnd in
microsoft/vstest#15724
* Fix HTML logger parallel file collision by @​nohwnd in
microsoft/vstest#15435
* Improve error message when testhost cannot be found by @​nohwnd in
microsoft/vstest#16053
* Fix HTML logger exception on invalid XML chars in test display names
by @​nohwnd in microsoft/vstest#16051
**Full Changelog**:
microsoft/vstest@v18.7.0...v18.8.0
Commits viewable in [compare
view](microsoft/vstest@v18.7.0...v18.8.1).
</details>
Updated [Microsoft.SourceLink.GitHub](https://github.com/dotnet/dotnet)
from 10.0.300 to 10.0.301.
<details>
<summary>Release notes</summary>
_Sourced from [Microsoft.SourceLink.GitHub's
releases](https://github.com/dotnet/dotnet/releases)._
## 10.0.301
You can build .NET 10.0 from the repository by cloning the release tag
`v10.0.301` and following the build instructions in the [main
README.md](https://github.com/dotnet/dotnet/blob/v10.0.301/README.md#building).
Alternatively, you can build from the sources attached to this release
directly.
More information on this process can be found in the [dotnet/dotnet
repository](https://github.com/dotnet/dotnet/blob/v10.0.301/README.md#building-from-released-sources).
Attached are PGP signatures for the GitHub generated tarball and
zipball. You can find the public key at https://dot.net/release-key-2023
Commits viewable in [compare
view](dotnet/dotnet@v10.0.300...v10.0.301).
</details>
Updated [ptr727.Utilities](https://github.com/ptr727/Utilities) from
4.0.7 to 4.0.15.
<details>
<summary>Release notes</summary>
_Sourced from [ptr727.Utilities's
releases](https://github.com/ptr727/Utilities/releases)._
## 4.0.15
## What's Changed
* Cover synchronous FileEx methods with temp-directory tests by @​ptr727
in ptr727/Utilities#399
* Promote: cover synchronous FileEx methods by @​ptr727 in
ptr727/Utilities#400
* conformance: per-surface lint architecture (editorconfig action + VS
Code lint tasks) by @​ptr727 in
ptr727/Utilities#401
* lint: EditorConfig rename + process-type VS Code Lint tasks by
@​ptr727 in ptr727/Utilities#402
* conformance: xUnit v3 migration, config hygiene, --pull=always lint
tasks by @​ptr727 in ptr727/Utilities#403
* Promote develop to main: xUnit v3 tests, per-surface lint,
--pull=always by @​ptr727 in
ptr727/Utilities#404
* Bump softprops/action-gh-release from 3.0.1 to 3.0.2 in the
actions-deps group by @​dependabot[bot] in
ptr727/Utilities#406
* Bump the nuget-deps group with 1 update by @​dependabot[bot] in
ptr727/Utilities#408
**Full Changelog**:
ptr727/Utilities@4.0.7...4.0.15
Commits viewable in [compare
view](ptr727/Utilities@4.0.7...4.0.15).
</details>
Updated [System.CommandLine](https://github.com/dotnet/dotnet) from
2.0.9 to 2.0.10.
<details>
<summary>Release notes</summary>
_Sourced from [System.CommandLine's
releases](https://github.com/dotnet/dotnet/releases)._
No release notes found for this version range.
Commits viewable in [compare
view](https://github.com/dotnet/dotnet/commits).
</details>
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@ptr727