move RequiresSuper analyzer into apple subdir, add doc for RequiresSuper analyzer
This commit is contained in:
Родитель
a47767a6ff
Коммит
7a0e316f2e
|
@ -0,0 +1,24 @@
|
|||
# XIA1004
|
||||
|
||||
## Cause
|
||||
|
||||
Overriding a method that requires a call to the overridden method
|
||||
|
||||
## Rule description
|
||||
|
||||
Notifies you when overriding a method with the `[RequiresSuper]` attribute
|
||||
|
||||
## How to fix violations
|
||||
|
||||
Apply the provided code fix to add base method call to overriding methods with the [RequiresSuper] attribute
|
||||
|
||||
## How to suppress violations
|
||||
|
||||
```csharp
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Notifications", "XI0004RequiresSuperAttribute:Add base method call to methods with the [RequiresSuper] attribute", Justification = "<Pending>")]
|
||||
```
|
||||
|
||||
```csharp
|
||||
#pragma warning disable XI0004RequiresSuperAttribute // Add base method call to methods with the [RequiresSuper] attribute
|
||||
#pragma warning restore XI0004RequiresSuperAttribute // Add base method call to methods with the [RequiresSuper] attribute
|
||||
```
|
|
@ -32,6 +32,8 @@ namespace Xamarin.CodeAnalysis
|
|||
public class XIA1004RequiresSuper : DiagnosticAnalyzer
|
||||
{
|
||||
public static readonly string DiagnosticId = "XI0004RequiresSuperAttribute";
|
||||
const string HelpLink = "https://github.com/xamarin/CodeAnalysis/blob/master/docs/XIA1004.md";
|
||||
|
||||
|
||||
static readonly DiagnosticDescriptor Rule =
|
||||
new DiagnosticDescriptor(
|
||||
|
@ -40,7 +42,8 @@ namespace Xamarin.CodeAnalysis
|
|||
"Overriding the {0} method requires a call to the overridden method",
|
||||
"Notifications",
|
||||
DiagnosticSeverity.Info,
|
||||
isEnabledByDefault: true
|
||||
isEnabledByDefault: true,
|
||||
HelpLink
|
||||
);
|
||||
|
||||
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);
|
Загрузка…
Ссылка в новой задаче