Repository navigation
chore(ci): collapse nested Path.Combine calls flagged by CA1877 - #610
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.Testwith:The flagged line is the
_testCasePathsetup that every rule test class shares (121 files, one per rule), where aPath.Combine("Rules", nameof(...))is nested inside the outerPath.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.Combinecall in every test class. Same resulting path, no behaviour change. No other test file nestsPath.Combinecalls.Verification
dotnet build ALCops.sln,dotnet format ALCops.sln --verify-no-changes,dotnet test ALCops.sln(all seven test projects pass).🤖 Generated with Claude Code