Topic | Value |
---|---|
Id | GU0020 |
Severity | Hidden |
Enabled | True |
Category | Gu.Analyzers.Correctness |
Code | GU0020SortProperties |
Sort properties by StyleCop rules then by mutability.
Order:
- get-only
- Expression body.
- private set;, protected set, internal set, public set.
To make it easier to keep an eye on state if any.
Sort the properties.
Configure the severity per project, for more info see MSDN.
#pragma warning disable GU0020 // Sort properties
Code violating the rule here
#pragma warning restore GU0020 // Sort properties
Or put this at the top of the file to disable all instances.
#pragma warning disable GU0020 // Sort properties
[System.Diagnostics.CodeAnalysis.SuppressMessage("Gu.Analyzers.Correctness",
"GU0020:Sort properties",
Justification = "Reason...")]