RehanSaeed / EditorConfig

A very generic .editorconfig file supporting .NET, C#, VB and web technologies.
MIT License
629 stars 171 forks source link

dotnet_style_parentheses_in_other_operators = never_if_unnecessary #58

Closed RehanSaeed closed 3 years ago

RehanSaeed commented 3 years ago

We got some better documentation from .NET about this setting which makes it clear that we should change our configuration from a suggestion of using always_for_clarity to a warning to use never_if_unnecessary:

https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0047-ide0048#dotnet_style_parentheses_in_other_operators

// dotnet_style_parentheses_in_other_operators = always_for_clarity
var v = (a.b).Length;

// dotnet_style_parentheses_in_other_operators = never_if_unnecessary
var v = a.b.Length;

The second example seems more desirable. Not sure if I should class this as a breaking change as per Semver as it was only a suggestion before.