Skip to content

Commit c8ddf24

Browse files
authored
Merge pull request #69 from messerli-informatik-ag/disable-SA1119
Disable SA1119 (StatementMustNotUseUnnecessaryParenthesis)
2 parents 6d749fd + 897f855 commit c8ddf24

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

CodeStyle/build/StyleCop.ruleset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
<Rule Id="SA1316" Action="Error" /><!-- TupleElementNamesShouldUseCorrectCasing -->
120120

121121
<!-- Maintainability Rules -->
122-
<Rule Id="SA1119" Action="Error" /><!-- StatementMustNotUseUnnecessaryParenthesis -->
122+
<Rule Id="SA1119" Action="None" /><!-- StatementMustNotUseUnnecessaryParenthesis -->
123123
<Rule Id="SA1400" Action="Error" /><!-- AccessModifierMustBeDeclared -->
124124
<Rule Id="SA1401" Action="Error" /><!-- FieldsMustBePrivate -->
125125
<Rule Id="SA1402" Action="None" /><!-- FileMayOnlyContainASingleType -->

Sandbox/UnnecessaryParenthesis.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System.Collections.Generic;
2+
using System.Linq;
3+
4+
namespace Sandbox
5+
{
6+
public static class UnnecessaryParenthesis
7+
{
8+
public static IEnumerable<int> ExpressionWithUnnecessaryParenthesis()
9+
=> (from x in Enumerable.Repeat(1, 1)
10+
from y in Enumerable.Repeat(2, 1)
11+
select x + y);
12+
}
13+
}

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,7 @@ Initial release
9595

9696
## 2.1.0
9797
* Warn when interface method has `public` accessibility modifier (`MESSERLI001`)
98+
99+
## Unreleased
100+
* Relaxed rules:
101+
* [SA1119](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1119.md) (StatementMustNotUseUnnecessaryParenthesis) is now disabled.

0 commit comments

Comments
 (0)