S3267: clear the last two generator loops - #166
Merged
Conversation
S3267 is now clean in Semantics.SourceGenerators. - DimensionsMetadata inspected only overload.Name inside its validation loop, so it now iterates Select(overload => overload.Name) directly. - DimensionsGenerator built one marker-interface ClassTemplate per dimension and added them one at a time; now Classes.AddRange(sortedDimensions.Select(...)). Verified with the local check: S3267 4 -> 0. Generated output byte-identical, no drift. Build clean on all TFMs, 1095/1095 tests pass.
|
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.



S3267is now clean inSemantics.SourceGenerators.DimensionsMetadatainspected onlyoverload.Nameinside its validation loop, so it now iteratesSelect(overload => overload.Name)directly and the body reads against astringrather than reaching through the object each time.DimensionsGeneratorbuilt one marker-interfaceClassTemplateper dimension and added them one at a time; nowClasses.AddRange(sortedDimensions.Select(...)).Verification
S3267inSemantics.SourceGenerators: 4 → 0dotnet build— 0 errors, 0 warnings, all target frameworksdotnet test— 1095/1095 passRemaining — ~24
S3776×6 is now the only rule left in the generator project, and the only one the local check still reports there. The rest sit outside it:S4136×8 inSemanticString.cs,S1133×10,S2342×2,S4144×1.As flagged on #165, two of those want a decision rather than a fix —
S1133means deleting[Obsolete]public API, andS2342means renaming public enums for a naming convention. Both are better triaged as Accepted in SonarCloud than changed unilaterally.