chore(analyzers)!: adopt the 3.45.0 analyzer baseline - #68
Open
glennawatson wants to merge 6 commits into
Open
Conversation
- Move StyleSharp, PerformanceSharp and SecuritySharp to 3.43.2 and take the shared .editorconfig, then clear the diagnostics that surfaced. - PascalCase every tuple element name on the public surface. WhenAnyValue, WhenChanged and WhenChanging now return (T1 Property1, ...) and Bind returns (object? View, bool IsViewModel). - Move Microsoft.Maui.Controls on net11 to 11.0.0-preview.7.26406.9, matching the workload that builds it. Roslyn stays pinned at the 4.8.0 shipping floor. - Relax SST2334 for tests and benchmarks. A fixture or harness is read through assertions, not a debugger summary; product code keeps the rule. - Suppress SST2461 on the DynamicallyAccessedMemberTypes polyfill. Its values must stay identical to the BCL enum the newer targets type-forward to. - Replace a racy bool latch in the initial-emit serialization test with Interlocked.Exchange. Two threads could pass it and mask the race it guards. BREAKING CHANGE: public tuple element names are now PascalCase. A caller reading x.property1 or x.view must read x.Property1 or x.View instead. Tuple element names are metadata only, so this is a source break, not a binary one.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #68 +/- ##
==========================================
+ Coverage 97.56% 97.87% +0.30%
==========================================
Files 228 229 +1
Lines 7840 7749 -91
Branches 1077 1060 -17
==========================================
- Hits 7649 7584 -65
+ Misses 143 118 -25
+ Partials 48 47 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- Add tests for DependencyObjectObservableForProperty, which had none: affinity scoring, change notification, teardown on dispose, and the two rejection paths. - Disposing the subscription is the case that mattered. It unhooks the value-changed handler, and nothing was exercising it. - Serialized with [NotInParallel]: the tests share one static DependencyProperty and AddValueChanged registers into a process-wide table keyed by it, so running them in parallel races on that table.
- Update StyleSharp, PerformanceSharp and SecuritySharp to 3.44.0, which adds SST2337 and fixes SST1503 and SST2266 misfires. - Enable SST2337 as an error. It found five parameters no body ever read, plus a sixth once the first removal orphaned its caller's argument. - Turn off the vendor rules that report the same defects as ours, so a single finding is not reported twice. CA1801 was among them and no longer ships at all, which left its stale justification on IDE0060 pointing at nothing. - Retire SST1461 in favour of SST2337, which covers private parameters and more. - Mark the Roslyn predicate tokens in RoslynHelpers as discards. The delegate shape fixes those signatures, and the rule's method-group exemption only sees same-file usages. - Collapse three GenerateRuntimeFallback tests into one. They differed only by the arguments removed here, so they had been asserting the same thing.
- Update StyleSharp, PerformanceSharp and SecuritySharp to 3.45.0, which folds SST2337 into SST1461 and drops SST2337. - Enable SST1461, now the single rule for a parameter no body reads, and remove the SST2337 entry along with the two duplicate notes that pointed at it. - Restore the cancellation tokens in RoslynHelpers to their real names. The rule now exempts a member carrying any attribute, and those already carry one, so the discards are no longer needed.
- Widen the remaining CommandExtractor members to internal and test each one directly: the view/view model sides, control binding, command and command parameter property detection, parameter overload detection, event args resolution and control capabilities. - Cover the toEvent argument shapes that resolve to no event name: absent, empty, and not a compile-time constant. The empty and non-constant cases were the uncovered half of that condition.
…pers - Add NotifyPropertyEmitter and route the INPC and IReactiveObject observation plugins through it. The two differed only in affinity, kind and IsAMatch; every emit body was identical. - Move the binding dispatch scaffold into BindingEmitterHelpers.Generate. The four Bind APIs now supply only the two emitters that differ. - Give each dispatch stub's exception documentation the name of its own API rather than one shared sentence repeated across every overload. - Duplicated lines across the six affected files drop from 591 to 435, and duplicated blocks from 126 to 63. Generated output is unchanged, which the snapshot suite verifies.
|
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 and maintenance, with one breaking change to the public surface.
What is the new behavior?
The repo builds against the 3.45.0 analyzer baseline and the shared .editorconfig, and public tuple element names are PascalCase.
WhenAnyValue,WhenChangedandWhenChangingreturn(T1 Property1, T2 Property2, ...)for arities 2 through 16, andBindreturnsIReactiveBinding<TView, (object? View, bool IsViewModel)>.RuntimeObservationFallbackno longer disagree about what an element is called.SST1461is enabled as an error. It found six parameters no body ever read, one of them only after removing the first orphaned its caller's argument.DependencyObjectObservableForPropertyhas tests. It had none. The teardown that unhooks the value-changed handler on dispose was entirely unexercised.SST2334is off for tests and benchmarks: a fixture or a harness is read through assertions, not a debugger summary. Product code still enforces it.SST2461is suppressed on theDynamicallyAccessedMemberTypespolyfill, whose values must stay numerically identical to the BCL enum the newer targets type-forward to.What is the current behavior?
x.property1,x.view), and disagree withRuntimeObservationFallback, which already returned PascalCase elements.Microsoft.Maui.Controlson net11 is pinned to preview.6.InitialEmitCompetitorin the initial-emit serialization test claims its turn with a plainboolcheck-then-set. Two threads can pass it, which throws out of the source's event handler or stalls instead of reporting the emission sequence - in the test that exists to catch exactly that class of race.What might this PR break?
x.property1orx.viewmust readx.Property1orx.View. Element names are metadata only, so existing binaries keep working and only recompilation is affected.Checklist
mainbranchAdditional information
Most of the diff is mechanical; the hand-written parts are a short list.
Mechanical, and safe to skim:
*.g.verified.cssnapshots - element casing, plus dispatch line numbers and their derived method-name hashes.[MethodImpl(MethodImplOptions.AggressiveInlining)]attributes and their imports, applied where the analyzer reported them.Worth actual review:
.editorconfig,src/tests/.editorconfig,src/benchmarks/.editorconfig,src/Directory.Packages.propsCodeGeneration/BindCodeGenerator.csandCodeGeneration/ObservationCodeGenerator.cs- the two places the generator emitted tuple element names as literalsSST1461removed, inCommandExtractor,SymbolHelpers,BindToInvocationGenerator,WhenAnyCodeGenerator,ObservationCodeGeneratorandBindingInvocationAnalyzerPolyfills/DynamicallyAccessedMemberTypes.cs- the suppression and its justificationObservables/PropertyChangingObservableInitialEmitSerializationTests.cs- the latch now usesInterlocked.ExchangeWpf.Tests/DependencyObjectObservableForPropertyTests.cs- new, and serialized because the tests share one staticDependencyPropertyWpf.Shared/BooleanToVisibilityTypeConverter.cs- restructured into an early-exit guard; both original branch expressions are preserved verbatimCommandExtractoris now internal throughout and each helper is tested directly, including thetoEventargument shapes that resolve to no event name.