From a7994db1c3bdacaeb4f49f0f53da9451cafebebc Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 18 Sep 2026 09:18:39 +0000 Subject: [PATCH] Fix CA1707 test-naming warnings and GitHub Actions Node 20 deprecation Two independent sources of noisy CI warnings: - CA1707 ("remove underscores from member name") was firing on every test method in MainFormMultiTabTests.cs despite the repo already having a [JianpuEditor.Tests/**/*.cs] .editorconfig section that suppresses it for test naming. The glob has a real quirk: "**/*.cs" only matches files inside a subdirectory, not files sitting directly in JianpuEditor.Tests/ itself -- which is exactly where MainFormMultiTabTests.cs lives (Glue/DocumentTabTests.cs, one level down, was already covered, which is why this went unnoticed). Widened the glob to "{*.cs,**/*.cs}" to cover both cases. Confirmed with a clean rebuild of the whole solution: 0 warnings, 0 errors (previously 10-11 CA1707 warnings from this one file). - The four pinned GitHub Actions (checkout, setup-dotnet, cache, upload-artifact) are still on major versions whose action.yml declares node20, which GitHub now runs on node24 anyway but warns about every build ahead of node20's removal from runners. Bumped each to the latest major version that declares node24 in its own action.yml (verified by fetching the actual action.yml at each tag, not just release notes): checkout v4 -> v7, setup-dotnet v4 -> v6, cache v4 -> v6, upload-artifact v4 -> v7, in both ci.yml and release.yml. Checked each for breaking changes relevant to this repo's usage (checkout v7's fork-PR restriction only affects pull_request_target/workflow_run triggers, which this repo doesn't use; the others are internal Node/ESM migrations with no input/output changes affecting the options already in use here). Verified via the same sandbox pipeline as prior changes: a clean `dotnet build` of the whole solution (temporarily cross-compiling JianpuEditor.Tests with EnableWindowsTargeting, reverted, not committed) now produces 0 warnings/0 errors, and dotnet format --verify-no-changes passes for both projects. The GitHub Actions version bumps themselves can't be executed in this sandbox (no GHA runner here) -- verified by fetching each new tag's actual action.yml to confirm node24 and reading each release's changelog for breaking changes, but the real test is this branch's next CI run. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Pguj4XSScE141p1ScWoqEr --- .editorconfig | 6 ++++-- .github/workflows/ci.yml | 8 ++++---- .github/workflows/release.yml | 10 +++++----- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.editorconfig b/.editorconfig index 7a5b361..042543e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -30,7 +30,9 @@ dotnet_diagnostic.CA1305.severity = none dotnet_diagnostic.CA1822.severity = suggestion dotnet_diagnostic.CA1859.severity = suggestion -[JianpuEditor.Tests/**/*.cs] -# xUnit test naming and inline test data arrays +[JianpuEditor.Tests/{*.cs,**/*.cs}] +# xUnit test naming and inline test data arrays. Note: "**/*.cs" alone only matches files in a +# subdirectory (an EditorConfig glob quirk) -- it silently skipped every *.cs file directly under +# JianpuEditor.Tests/ (e.g. MainFormMultiTabTests.cs), which is why CA1707 kept firing for those. dotnet_diagnostic.CA1707.severity = none dotnet_diagnostic.CA1861.severity = none \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f987381..78b0900 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,10 +14,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v6 with: dotnet-version: 8.0.x cache: true @@ -26,7 +26,7 @@ jobs: **/*.csproj - name: Cache .NET build outputs - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: | JianpuEditor/obj @@ -56,7 +56,7 @@ jobs: run: ./scripts/test-midi-export.ps1 - name: Upload Release build - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: JianpuEditor-${{ github.sha }} path: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1bda62d..c715b2b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Resolve version id: version @@ -47,7 +47,7 @@ jobs: Set-Content -Path $iss -Value $content -NoNewline - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v6 with: dotnet-version: 8.0.x cache: true @@ -56,7 +56,7 @@ jobs: **/*.csproj - name: Cache .NET build outputs - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: | JianpuEditor/obj @@ -125,7 +125,7 @@ jobs: Write-Host "Portable package: $zip ($([math]::Round((Get-Item $zip).Length / 1MB, 2)) MB)" - name: Upload installer artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: JianpuEditor-Setup-${{ steps.version.outputs.value }} path: | @@ -135,7 +135,7 @@ jobs: retention-days: 90 - name: Upload portable artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: JianpuEditor-Portable-${{ steps.version.outputs.value }} path: ${{ steps.portable.outputs.zip }}