Repository navigation
chore(analyzers): update the Sharp analyzers to 3.45.0 and adopt PublicApiSharp - #164
Merged
Merged
Conversation
ChrisPulman
approved these changes
Aug 15, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #164 +/- ##
==========================================
- Coverage 98.14% 98.10% -0.05%
==========================================
Files 680 680
Lines 21432 21359 -73
Branches 2619 2622 +3
==========================================
- Hits 21035 20954 -81
- Misses 197 199 +2
- Partials 200 206 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…icApiSharp - Update StyleSharp/PerformanceSharp/SecuritySharp.Analyzers to 3.45.0, plus SonarAnalyzer 10.32.0, Roslynator 4.16.0, TUnit 1.65.0, Test.Sdk 18.9.0, CodeCoverage 18.10.0, SourceLink 10.0.400, WindowsAppSDK 2.4.0 and the net11 AspNetCore preview leg. - Replace Microsoft.CodeAnalysis.PublicApiAnalyzers with PublicApiSharp.Analyzers, collapsing the per-TFM Shipped/Unshipped baseline pair into a single PublicAPI/<tfm>/PublicAPI.txt the analyzer resolves itself. - Regenerate all 136 (project, TFM) baselines; the 16 Apple legs were generated on a real Windows guest, which is the only host carrying those workloads. - Fix the analyzer fallout the newly enabled rules report: aggressive-inlining hints, debugger displays, exception docs, doc-element ordering, interlocked one-shot latches, guard-clause inversions, explicit enum values and tuple casing. - Unify the extension-block receiver name per receiver type, which the baseline generator records once per type.
glennawatson
force-pushed
the
chore/analyzers-3.45-publicapisharp
branch
from
August 15, 2026 12:42
24a483d to
bacf76a
Compare
|
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 / chore - analyzer package updates, a public-API tracking swap, and the code changes the newly enabled rules require.
What is the new behavior?
The Sharp analyzers move to 3.45.0, public-API tracking moves to PublicApiSharp, and the code satisfies the rules the repo already had switched on.
PublicAPI/<tfm>/PublicAPI.txt, written in a C#-like declaration form, and the analyzer resolves that path itself - theAdditionalFileswiring inDirectory.Build.propsis gone, replaced byEnablePublicApiBaseline..Analyzers3.45.0, SonarAnalyzer 10.32.0, Roslynator 4.16.0, TUnit 1.65.0, Microsoft.NET.Test.Sdk 18.9.0, Testing.Extensions.CodeCoverage 18.10.0, SourceLink 10.0.400, WindowsAppSDK 2.4.0, and the net11 AspNetCore.Components preview leg. Microsoft.CodeAnalysis.CSharp stays pinned on 4.14 for the reason recorded inDirectory.Packages.props.[DebuggerDisplay]on publicly visible types.<exception>elements for exceptions a member throws directly, and XML doc elements put back in conventional order.boollatches converted toint+Interlocked.Exchange, so two threads can no longer both pass a check-then-set guard.ifbodies inverted into early-exit guards, explicit enum member values, PascalCase tuple elements, andUnsafeRegisterfor cancellation callbacks that do not depend on ambient context.What is the current behavior?
.editorconfigmarks as errors had no corresponding fixes in the source.Microsoft.CodeAnalysis.PublicApiAnalyzers, with aPublicAPI.Shipped.txt/PublicAPI.Unshipped.txtpair per target framework and explicitAdditionalFilesitems to point at them.What might this PR break?
Continuation.Lock<T>andContinuation.LockValueTask<T>takeIObserver<(T Value, IDisposable Sync)>; the first element wasvalue. Binary compatible, source-breaking only for code naming that element.SyncTimer,StartandWhileonReactiveExtensionsbecome extension-block members, as doFromAsyncandStartonSignalAsyncReactiveExtensionsandDelayAsynconSignalAsyncExtensions. Instance-form and static-form calls both still bind; the emitted implementation signatures are unchanged.Checklist
mainbranchAdditional information
Most of the diff is generated. Every
PublicAPI/<tfm>/PublicAPI.txtis tool output - regenerated from scratch, not hand-edited - and the bulk of the remaining files gain only an attribute, a using directive, or a doc element. The hand-written parts worth reviewing are:src/Directory.Build.propsandsrc/Directory.Packages.props- the package swap and the baseline wiring.src/Primitives.Shared/SignalOperatorParityMixins.RxNames.SubscribeSafe.cs- carries two scoped[SuppressMessage]attributes for PAS0003. The twoSubscribeSafeoverloads there differ only by generic constraint (where T : class/where T : struct); the baseline records both, but an entry is resolved by the constraint-erased signature and compared against the first match, so exactly one of the pair can ever match.The Apple target-framework baselines (ios, tvos, macos, maccatalyst) were generated on a host carrying those workloads, since Linux cannot enumerate or build them.