Skip to content

Improve handling of records #79

Closed

Description

@bjornhellander

Records does not seem to be fully handled:

Image
Rule(s) File Notes
SA1203 StyleCop.Analyzers/StyleCop.Analyzers/OrderingRules/SA1203ConstantsMustAppearBeforeFields.cs ImmutableArray.Create(Class, Struct)
SA1204 StyleCop.Analyzers/StyleCop.Analyzers/OrderingRules/SA1204StaticElementsMustAppearBeforeInstanceElements.cs ImmutableArray.Create(Class, Struct)
SA1206 StyleCop.Analyzers/StyleCop.Analyzers/OrderingRules/SA1206DeclarationKeywordsMustFollowOrder.cs has a comment noting the union pseudo-kind is also missing — records never considered
SA1207 StyleCop.Analyzers/StyleCop.Analyzers/OrderingRules/SA1207ProtectedMustComeBeforeInternal.cs same pattern
SA1214 StyleCop.Analyzers/StyleCop.Analyzers/OrderingRules/SA1214ReadonlyElementsMustAppearBeforeNonReadonlyElements.cs same pattern
SA1601 StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1601PartialElementsMustBeDocumented.cs Class, Struct, Interface — partial records skipped
SA1620/SA1621/SA1622 StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/GenericTypeParameterDocumentationAnalyzer.cs Class, Struct, Interface — typeparam docs skipped for records
SA1648 StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1648InheritDocMustBeUsedWithInheritingClass.cs Class, Struct, Interface, Enum, Delegate
SA1506 StyleCop.Analyzers/StyleCop.Analyzers/LayoutRules/SA1506ElementDocumentationHeadersMustNotBeFollowedByBlankLine.cs HandledSyntaxKinds — union comment present, records absent
SA1514 StyleCop.Analyzers/StyleCop.Analyzers/LayoutRules/SA1514ElementDocumentationHeaderMustBePrecededByBlankLine.cs same pattern
SA1200 StyleCop.Analyzers/StyleCop.Analyzers/OrderingRules/SA1200UsingDirectivesMustBePlacedCorrectly.cs case list for suppressing the "usings outside namespace" check on top-level types omits RecordDeclaration/RecordStructDeclaration

Activity

  1. changed the title [-]Review and probably improve handling of records[/-] [+]Improve handling of records[/+] on Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions