Repository navigation
fix(analyzers): report partial members once and add partial-shape fixtures - #157
Merged
Merged
Conversation
…tures Co-Authored-By: Claude
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.
Executive Summary
A symbol action receives the defining symbol and the implementing symbol of a partial member as separate events, so member-level rules reported the same diagnostic twice for one logical member.
MidNameUnderscoreAnalyzerreproduced the duplicate for a partial property. The newPartialMembers.IsImplementationParthelper detects the implementing source symbol throughPartialDefinitionPart, and the four member-level symbol rules skip that event, so a partial member reports once, at its defining part.The same session audited the two analyzer roadmap items raised by the pugworks
GeneratedRegexAnalyzersilence in 2.9.7. At the Roslyn version this repository pins, no silently-dead registration reproduces: attribute node actions fire on partial declarations with and without an implementation part, across files, and with a generated implementation part. Every analyzer that ships a code fix registers that fix for each rule id it reports; the audit found and closed one missing fixture (the E128108 shape ofLowValueTestCodeFixProvider).Code Changes
src/E128.Analyzers/PartialMembers.cs: new shared helper.IsImplementationPartclassifies the implementing source symbol of a partial method, partial property, or a parameter of one.MidNameUnderscoreAnalyzer,ByteSizeForDataSizeAnalyzer,TimeSpanForDurationAnalyzer, andMutableCollectionExposureAnalyzer(method and property callbacks).TimeSpanForDurationAnalyzeralso extracts aGetDetailsswitch to stay inside the complexity ceiling.ObsoleteWithoutMessageAnalyzer(E128169),UnjustifiedSuppressionAttributeAnalyzer(E128173),DynamicallyAccessedMembersGuardAnalyzer(E128049),AggressiveOptimizationAnalyzer(E128116), andDllImportToLibraryImportAnalyzer(E128117). Each proves the rule fires on a partial declaration, the source-generator shape.MissingTraitCategoryAnalyzerandUntrackedSkipAnalyzerstay out of scope: a partial test method is not a real-world shape.LowValueTestCodeFixTestsgains the missing E128108 fix fixture.AnalyzerReleases.Unshipped.mdstays empty andanalyzer-promote.shreportedempty.Tests and Tooling
scripts/check.sh --allpasses: shell lint, format check, build, and tests. Full suite: 2903 tests, 2901 passed, 0 failed, 2 skipped (both predate this change). Lode files updated:analyzers/authoring.mdrecords the probed partial-declaration behavior and the helper contract,shared-helpers.mdlists the helper,release-tracking.mdrecords the release, andplans/roadmap.mdrecords both audit outcomes.Review Guide
Start with
PartialMembers.cs(29 lines), then the four early-return call sites. Each partial-shape fixture names its expected single diagnostic span. Theanalyzer-release-check.shandreadme-table-diff.sh --analyzeroutputs are clean.Rollback
Revert the single commit. No data, schema, or configuration migration involved.
Links
Roadmap item source: the 2.9.7
GeneratedRegexAnalyzerdetection audit recorded inplans/roadmap.md.🤖 Generated with Claude Code