Skip to content

Commit

Permalink
documentation for suppression attribute added
Browse files Browse the repository at this point in the history
  • Loading branch information
dersteve committed Jan 21, 2016
1 parent ac6bfbd commit ee39c4b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions documentation/AvoidAsyncSuffix.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ To fix a violation of this rule, remove the `Async` suffix from the method name

## How to suppress violations

```csharp
[SuppressMessage("AsyncUsage.CSharp.Naming", "AvoidAsyncSuffix", Justification = "Reviewed.")]
```

```csharp
#pragma warning disable AvoidAsyncSuffix // Avoid Async suffix
public int ThisIsNotAsync()
Expand Down
4 changes: 4 additions & 0 deletions documentation/AvoidAsyncVoid.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ To fix a violation of this rule, change the signature of the method to return a

## How to suppress violations

```csharp
[SuppressMessage("AsyncUsage.CSharp.Reliability", "AvoidAsyncVoid", Justification = "Reviewed.")]
```

```csharp
#pragma warning disable AvoidAsyncVoid // Avoid async void
private async void HandleSomeEvent(object sender, EventArgs e)
Expand Down
4 changes: 4 additions & 0 deletions documentation/UseAsyncSuffix.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ To fix a violation of this rule, rename the method to include the `Async` suffix

## How to suppress violations

```csharp
[SuppressMessage("AsyncUsage.CSharp.Naming", "UseAsyncSuffix", Justification = "Reviewed.")]
```

```csharp
#pragma warning disable UseAsyncSuffix // Use Async suffix
public async Task<int> GetValue()
Expand Down
4 changes: 4 additions & 0 deletions documentation/UseConfigureAwait.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ the asynchronous operation.

## How to suppress violations

```csharp
[SuppressMessage("AsyncUsage.CSharp.Usage", "UseConfigureAwait", Justification = "Reviewed.")]
```

```csharp
#pragma warning disable UseConfigureAwait // Use ConfigureAwait
await Task.Delay(1000);
Expand Down

0 comments on commit ee39c4b

Please sign in to comment.