feat!: move to StyleSharp analyzers and ReactiveUI 26, add ReactiveUI.Validation.Reactive - #990
Merged
Merged
Conversation
….Validation.Reactive - Replace StyleCop.Analyzers and Roslynator with StyleSharp, PerformanceSharp and SecuritySharp, matching ReactiveUI.Binding.SourceGenerators. - Fix every analyzer finding in the library, AndroidX, tests and samples. - Update NuGet packages, including ReactiveUI 26 and TUnit 1.72. - Use the WhenAnyValueUnsafe overloads where an expression is passed in, since ReactiveUI 26 only intercepts literal lambdas. - Resolve the default formatter with GetServices. Containers that throw from GetService for an unregistered type then fall back to the default formatter (#979). - Add ReactiveUI.Validation.Reactive, built from the same source against ReactiveUI.Reactive (#967). - Track the public API with PublicApiSharp baselines in place of the Verify approval tests. - Raise the MinVer floor to 8.0. BREAKING CHANGE: Requires ReactiveUI 26. View model type parameters need a class constraint. Optional parameters on public methods and constructors are now overloads, so callers must recompile.
This was referenced Oct 3, 2026
- Set AndroidGenerateResourceDesigner to false for every Android target. - The libraries ship no Android resources, so the designer only added an empty public Resource type.
- Build the AndroidX extensions a second time against ReactiveUI.AndroidX.Reactive and ReactiveUI.Validation.Reactive. - Apps on ReactiveUI.Reactive get the TextInputLayout bindings under ReactiveUI.Validation.Reactive.Extensions.
- Copy .gitattributes from ReactiveUI.Binding.SourceGenerators. - A Windows checkout with core.autocrlf rewrites files to CRLF, and the line-ending analyzer then fails the Windows build.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #990 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 21 23 +2
Lines 665 694 +29
Branches 114 104 -10
=========================================
+ Hits 665 694 +29 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- Remove the validity subject in BasePropertyValidation. Nothing ever pushed a value into it. - Bind ValidationContext properties by name. The generated ToProperty never runs the lambda, which left those lines uncovered. - Cover the Dispose(false) paths, the parameterless overloads and the non-generic enumerators.
ChrisPulman
approved these changes
Oct 3, 2026
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
This moves ReactiveUI.Validation to ReactiveUI 26 and the StyleSharp analyzer set. It also adds a package for apps that use ReactiveUI.Reactive.
.editorconfigas ReactiveUI.Binding.SourceGenerators.ReactiveUI.Validation.Reactivebuilds the same source against ReactiveUI.Reactive. Its namespaces start withReactiveUI.Validation.Reactive, and it takes System.ReactiveISchedulerinstances.ReactiveUI.Validation.AndroidX.Reactivedoes the same for the AndroidXTextInputLayoutbindings.Resourceclass. The libraries ship no Android resources.GetServices. A dependency injection container that throws for an unregistered type falls back toSingleLineFormatter.PublicAPI/<tfm>/PublicAPI.txt. They replace the Verify approval tests.Why
ReactiveValidationObjectthrewInvalidOperationExceptionforIValidationTextFormatter<string>. Closes [Bug]: Custom DI container with RxUI - Unable to resolve type IValidationTextFormatter #979.Breaking changes
WhenAnyValueneeds a reference-type sender.BasePropertyValidation<TViewModel, TViewModelProperty>and theValidationRuleextensions needTViewModelto be a class.strict: false, must pass the earlier ones too.ValidationRulethrowsArgumentExceptionfor an empty message. It still throwsArgumentNullExceptionfor a null one.Resourceclass is removed from the Android assemblies.ReactiveValidationObjectandObservableValidationBaseare no longerabstract. Their constructors stayprotected.How this was verified
The full test suite runs twice, once against each package. New tests cover the formatter fallback with a container that throws for unregistered types.
Notes for the reviewer
staticlambdas and named constants. It is safe to skim.ValidationBinding,ValidationTextFormatterResolverandReactiveUI.Validation.Reactive.csproj.REACTIVE_SHIM. The library's own namespaces are imported inReactiveUI.Validation.Usings.props, so the same file compiles into both packages.ViewForExtensionsclasses, SST2307 onValidationBinding.ForViewModel, SST2309 on two interface members, CA1005 onObservableValidation<TViewModel, TValue, TProp>, and SST1436 on theIsExternalInitpolyfill. Each fix would break public API or is not possible in C#.WhenAnyValuecalls whose selector returns an anonymous type or a private nested type, and the call then throws at run time. Two tests were adjusted for this. It needs a fix in ReactiveUI.Binding.SourceGenerators.Checklist