Skip to content

Commit

Permalink
Merge pull request #3765 from bjornhellander/feature/sa1025-doc-3684
Browse files Browse the repository at this point in the history
Update SA1025 documentation to reflect handling of multiple spaces preceding a symbol
  • Loading branch information
sharwell authored Jan 2, 2024
2 parents f139428 + b281c18 commit 47801cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ namespace StyleCop.Analyzers.SpacingRules
/// </summary>
/// <remarks>
/// <para>A violation of this rule occurs whenever the code contains multiple whitespace characters in a row, unless
/// the characters come at the beginning or end of a line of code, following a comma or semicolon or preceding a
/// symbol.</para>
/// the characters come at the beginning or end of a line of code, or following a comma or semicolon.</para>
/// </remarks>
[DiagnosticAnalyzer(LanguageNames.CSharp)]
internal class SA1025CodeMustNotContainMultipleWhitespaceInARow : DiagnosticAnalyzer
Expand Down
10 changes: 8 additions & 2 deletions documentation/KnownChanges.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,14 @@ StyleCop Classic allowed multiple spaces to precede a comment placed at the end
int x; // comment
```

StyleCop Analyzers does not currently make an exception to the SA1025 rule for this case, although this decision is
still under review.
It also allowed multiple spaces preceding a symbol, such as in the second line of the following code:

```csharp
int xyz = 1;
int w = 1;
```

StyleCop Analyzers does not currently make an exception to the SA1025 rule for these cases.

## Readability Rules

Expand Down
2 changes: 1 addition & 1 deletion documentation/SA1025.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The code contains multiple whitespace characters in a row.
## Rule description

A violation of this rule occurs whenever the code contains multiple whitespace characters in a row, unless the
characters come at the beginning or end of a line of code, following a comma or semicolon or preceding a symbol.
characters come at the beginning or end of a line of code, or following a comma or semicolon.

## How to fix violations

Expand Down

0 comments on commit 47801cc

Please sign in to comment.