Skip to content

Latest commit

 

History

History
23 lines (22 loc) · 3 KB

OrderingRules.md

File metadata and controls

23 lines (22 loc) · 3 KB

Ordering Rules (SA1200-)

Rules which enforce a standard ordering scheme for code contents.

Identifier Name Description
SA1200 UsingDirectivesMustBePlacedCorrectly A C# using directive is placed outside of a namespace element.
SA1201 ElementsMustAppearInTheCorrectOrder An element within a C# code file is out of order in relation to the other elements in the code.
SA1202 ElementsMustBeOrderedByAccess An element within a C# code file is out of order within regard to access level, in relation to other elements in the code.
SA1203 ConstantsMustAppearBeforeFields A constant field is placed beneath a non-constant field.
SA1204 StaticElementsMustAppearBeforeInstanceElements A static element is positioned beneath an instance element of the same type.
SA1205 PartialElementsMustDeclareAccess The partial element does not have an access modifier defined.
SA1206 DeclarationKeywordsMustFollowOrder The keywords within the declaration of an element do not follow a standard ordering scheme.
SA1207 ProtectedMustComeBeforeInternal The keyword protected is positioned after the keyword internal within the declaration of a protected internal C# element.
SA1208 SystemUsingDirectivesMustBePlacedBeforeOtherUsingDirectives A using directive which declares a member of the System namespace appears after a using directive which declares a member of a different namespace, within a C# code file.
SA1209 UsingAliasDirectivesMustBePlacedAfterOtherUsingDirectives A using-alias directive is positioned before a regular using directive.
SA1210 UsingDirectivesMustBeOrderedAlphabeticallyByNamespace The using directives within a C# code file are not sorted alphabetically by namespace.
SA1211 UsingAliasDirectivesMustBeOrderedAlphabeticallyByAliasName The using-alias directives within a C# code file are not sorted alphabetically by alias name.
SA1212 PropertyAccessorsMustFollowOrder A get accessor appears after a set accessor within a property or indexer.
SA1213 EventAccessorsMustFollowOrder An add accessor appears after a remove accessor within an event.
SA1214 ReadonlyElementsMustAppearBeforeNonReadonlyElements A readonly field is positioned beneath a non-readonly field.
SA1215 InstanceReadonlyElementsMustAppearBeforeInstanceNonReadonlyElements An instance readonly element is positioned beneath an instance non-readonly element of the same type.
SA1216 UsingStaticDirectivesMustBePlacedAtTheCorrectLocation A using static directive is positioned at the wrong location (before a regular using directive or after an alias using directive).
SA1217 UsingStaticDirectivesMustBeOrderedAlphabetically The using static directives within a C# code file are not sorted alphabetically by full type name.