Skip to content

Commit

Permalink
Clarify that SA1413 is also reported for enum members
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Jun 16, 2017
1 parent af15571 commit ff4f970
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions documentation/SA1413.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

## Cause

The last statement in a multi-line C# initializer is missing a trailing comma.
The last statement in a multi-line C# initializer or list is missing a trailing comma.

### Rationale

Expand All @@ -31,7 +31,7 @@ continue to show the original author and commit for the item that was previously

## Rule description

A violation of this rule occurs when the last statement of a C# initializer is missing a trailing comma.
A violation of this rule occurs when the last statement of a C# initializer or list is missing a trailing comma.

For example, the following code would generate one instance of this violation:

Expand All @@ -55,6 +55,8 @@ var x = new Barnacle
};
```

This diagnostic is also reported for other forms of comma-separated list, such as enum members.

## How to fix violations

To fix a violation of this rule, add a trailing comma to the last statement in the initializer.
Expand Down

0 comments on commit ff4f970

Please sign in to comment.