Skip to content

chore(ci): collapse nested Path.Combine calls flagged by CA1877 - #610

Merged
Arthurvdv merged 1 commit into
mainfrom
chore/ci-ca1877-collapse-path-combine
Nov 13, 2026
Merged

Arthurvdv merged 1 commit into
mainfrom
chore/ci-ca1877-collapse-path-combine

Conversation

@Arthurvdv

Copy link
Copy Markdown
Member

Summary

CI test legs have been failing since the scheduled build of 2026-11-12 (and on every PR since, e.g. #609) in the step Build ALCops.ApplicationCop.Test with:

error CA1877: Multiple consecutive Path.Combine operations can be collapsed into a single operation

The flagged line is the _testCasePath setup that every rule test class shares (121 files, one per rule), where a Path.Combine("Rules", nameof(...)) is nested inside the outer Path.Combine. Newer .NET 10 SDK builds on the runners ship this NetAnalyzers rule; warnings are errors here, so the test projects no longer compile on those legs. Which legs fail varies by runner image, so the symptom looked like a flake.

Change

Pass all segments to a single Path.Combine call in every test class. Same resulting path, no behaviour change. No other test file nests Path.Combine calls.

Verification

  • dotnet build ALCops.sln, dotnet format ALCops.sln --verify-no-changes, dotnet test ALCops.sln (all seven test projects pass).
  • The rule cannot be reproduced locally (SDK 10.0.303 does not carry it); the CI matrix on this PR is the real check.

🤖 Generated with Claude Code

Every rule test class built its fixture path with a Path.Combine nested
inside another Path.Combine. The NetAnalyzers rule CA1877 that newer .NET
SDK builds on the CI runners ship reports this as a warning, and warnings
are errors in this repository, so the per-SDK test legs fail before any
test runs. Passing all segments to one Path.Combine call yields the same
path.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Arthurvdv
Arthurvdv merged commit 2674684 into main Nov 13, 2026
53 checks passed
@Arthurvdv
Arthurvdv deleted the chore/ci-ca1877-collapse-path-combine branch November 13, 2026 13:53
Sign up for free to 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.

1 participant