Skip to content

Remove the classic Sequence and FunctionalAssert forms and retire λ1202 and λ1203 - #1042

Open
FreeApophis wants to merge 1 commit into
result-match-error-firstfrom
remove-classic-forms
Open

FreeApophis wants to merge 1 commit into
result-match-error-firstfrom
remove-classic-forms

Conversation

@FreeApophis

Copy link
Copy Markdown
Member

Closes #1003 and #1019, as decided in the grooming of 29 Oct 2026. Stacked on #1041 (base result-match-error-first); retarget once the chain #1037 → #1039 → #1040 → #1041 has merged.

Funcky

  • The static class Funcky.Sequence (nine files) is removed; the constructors are the Enumerable.Return, Enumerable.Successors, … extension members of EnumerableExtensions that 3.8.0 added. Nothing in the library used the class; the tests in Funcky.Test/Sequence now exercise the Enumerable form. PublicAPI: 16 *REMOVED* lines per asset.
  • λ1001 (Enumerable.Repeat(x, 1)) now proposes Enumerable.Return(x); the fix emits the BCL Enumerable type as receiver, and the rule is only active when EnumerableExtensions declares a static Return. λ1013 reports Enumerable.Return(x) for a collection expression; it matches the member through the unnamed extension type nested in EnumerableExtensions. Both test fixtures carry an extension-block stub now; the using static case of the λ1001 qualification test is gone, since a static extension member is not importable that way.

Funcky.Xunit 3.0.0 / Funcky.Xunit.v3 2.0.0

  • FunctionalAssert (six files) is removed; the Assert.Some, Assert.None, Assert.Ok, Assert.Error, Assert.Left, Assert.Right extension members are the assertions. PublicAPI: 12 *REMOVED* lines each.
  • Assertion failure label must become Assert.X() when FunctionalAssert is removed #1019: the failure label is Assert.Some() Failure: Values differ, matching xunit's Assert.Equal() Failure. The FunctionalAssertClass tests moved to AssertClass and exercise the Assert form with the new label; the stack-trace tests look for the AssertExtensions frame on net48.
  • Package readmes and the Funcky.Xunit readme describe the Assert form only.

Funcky.Analyzers 3.0.0

  • λ1202 (PreferEnumerableSequenceConstructorsAnalyzer) and λ1203 (PreferXunitAssertAnalyzer) are removed with their fixes and tests; AnalyzerReleases.Unshipped.md lists them under Removed Rules, the numbers stay reserved. Their doc pages and the rules-table rows are gone.
  • λ1201 stays and loses the C# 14 gate (ExtensionMemberSupport.SupportsExtensionMembers and the "below C# 14" test), as groomed: the .NET 10 SDK baseline always binds the extension forms.
  • The now unused GetSequenceType and GetFunctionalAssertType helpers are removed.

Docs and changelog

Sequence chapter, λ1001, λ1013, λ1101, λ1201, the rules overview, the xunit chapter (removal, new label, upgrade path via λ1203 on 2.x), README, and three changelog bullets under 4.0.0 describing the upgrade recipe (set λ1202/λ1203 to warning on 3.8.0, fix-all, upgrade). #1033 remains the place for the full upgrade guide.

Verified locally: Release build of the solution with TreatWarningsAsErrors, Funcky.Test on net11/net10/net9/net8/net48, Funcky.Xunit.Test on net11 and net48, Funcky.Xunit.v3.Test, Funcky.Async.Test, Funcky.Analyzers.Test 256/256.

🤖 Generated with Claude Code

…02 and λ1203

The static class Funcky.Sequence goes; its constructors live on as the static
extension members of System.Linq.Enumerable that 3.8.0 added. λ1001 now
proposes Enumerable.Return and λ1013 reports Enumerable.Return where a
collection expression fits. Funcky.Xunit 3.0.0 and Funcky.Xunit.v3 2.0.0 drop
the FunctionalAssert class in favour of the Assert extension members, and the
failure label becomes Assert.Some() to match xunit's own Assert.Equal() Failure.
λ1202 and λ1203 retire from Funcky.Analyzers, since the forms they pointed
away from no longer compile; λ1201 stays as an opt-in style rule and loses its
C# 14 language gate, which the .NET 10 SDK baseline makes moot. The PublicAPI
files record the removals, the tests use the surviving forms, and the
documentation describes the upgrade path through the 3.8.0 rules.

Closes #1003
Closes #1019

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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