build(analyzers): adopt StyleSharp, PerformanceSharp and SecuritySharp - #49
Open
glennawatson wants to merge 1 commit into
Open
build(analyzers): adopt StyleSharp, PerformanceSharp and SecuritySharp#49glennawatson wants to merge 1 commit into
glennawatson wants to merge 1 commit into
Conversation
glennawatson
force-pushed
the
feature/roslyn-common-analyzers
branch
from
July 28, 2026 01:04
cbe989c to
bfcd5fa
Compare
- Bring the .editorconfig over from the ReactiveUI repo, keeping this project's file header, and add a test-scoped file for the relaxations that only make sense in fixtures. - Update dependencies: TUnit, Verify, NSubstitute, Splat, ReactiveUI 24 and System.Reactive 7. Pin the generator and analyzer to Roslyn 4.8 so they keep loading under VS 2022 17.8 and the .NET 8 SDK. - Drop the unused System.Reactive reference from ReactiveUI.Binding and put the library on ReactiveUI.Primitives, leaving System.Reactive to ReactiveUI.Binding.Reactive. - Fix a binding defect the analyzer work surfaced: the runtime stub named its second converter viewToVmConverter while the generated overload emitted viewToViewModelConverter, so a named argument bound to a different parameter depending on which path served the call. Both are now viewModelToViewConverter and viewToViewModelConverter, matching viewModelProperty. - Seed the generator test compilations from ReactiveObject as well as IReactiveObject. ReactiveUI 24 moved the interface into another assembly, so walking references from it no longer reached the one declaring ReactiveObject and every ReactiveObject fixture failed to compile. - Keep the runtime dispatch stubs as classic extension methods. As extension block members they outrank the generated concrete overload, so bindings fall through to the runtime path and throw instead of dispatching. - Resolve the analyzer findings across the runtime library, generator, analyzer and tests, and regenerate the generator snapshots.
glennawatson
force-pushed
the
feature/roslyn-common-analyzers
branch
from
July 28, 2026 03:19
bfcd5fa to
e258427
Compare
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.
What kind of change does this PR introduce?
Build / refactor - analyzer stack migration, dependency updates, and the source changes needed to satisfy the new rules.
What is the new behavior?
stylecop.jsonand itsAdditionalFilesentry are gone..editorconfigis the one from the reactiveui repository, with this repo's copyright header substituted intofile_header_template.src/tests/.editorconfigcarries the test-scoped relaxations alongside it.VersionOverride, so consumers on the .NET 8 SDK (Visual Studio 2022 17.8) can still load them. The centralMicrosoft.CodeAnalysis.CSharpversion stays at 4.14.0 because the test and benchmark tooling requires it (Basic.Reference needs 4.11 or later, BenchmarkDotNet needs 4.14 or later).vmProperty,vmPropertyExpression,vmToViewConverterandviewToVmConverterparameters are nowviewModelProperty,viewModelPropertyExpression,viewModelToViewConverterandviewToViewModelConverter, in both the runtime library and the generated dispatch stubs. The generator's parameter matchers accept the old spelling as well, so ReactiveUI's own API shape is still detected.Lockresolves through a target-framework-conditionalUsingalias (the pattern used in the Primitives repo) instead of#ifblocks at each declaration.IndexandRangepolyfills are added for the targets that predate them.What is the current behavior?
The repository used the older style analyzer package with a locally maintained
.editorconfig, pinned Roslyn at 4.14.0 for every project, declaredLockbehind per-site#if NET9_0_OR_GREATERblocks, and exposed the binding APIs through classic extension methods with abbreviated view model parameter names.What might this PR break?
vmProperty:,vmToViewConverter:). No call sites in this repository used named arguments for them.System.Reactive7.0.0 has no net462 asset. It resolves through netstandard2.0 for the .NET Framework targets, exactly as 6.1.0 did.Checklist
mainbranchAdditional information
This branch is not finished and CI will fail on it.
ReactiveUI.Binding.Testswith a few in the generator: 59 test literals that need named constants, 31 methods over the length limit, 16 unused type parameters on test stubs that mirrorICreatesCommandBinding, and roughly 86 documentation, blank-line, long-line and visibility items.src/tests/ReactiveUI.Binding.SourceGenerators.Testsstill contain the old parameter names and need regenerating once the build is green, using the AutoVerify flow described in CLAUDE.md.TaskCompletionSourceinstances now passTaskCreationOptions.RunContinuationsAsynchronously, ignored return values are assigned to discards, andDisposable.Createcalls use the state-carrying overload to avoid closure captures. These are worth a careful read during review.WhenAnyoverloads (parameter count and method length), CallerInfo dispatch stubs with optional parameters, interface-dictated type parameters, the marker interface, the compiler-requiredIsExternalInittype, and the polyfill enum that mirrors the framework's own flag values. Each carries a justification. Stale suppressions for rules the new configuration no longer enables were removed rather than translated.