DotNetAnalyzers / StyleCopAnalyzers

An implementation of StyleCop rules using the .NET Compiler Platform
MIT License
2.61k stars 506 forks source link

SA1010 Opening square brackets should not be preceded by a space #3824

Closed daleao closed 2 months ago

daleao commented 2 months ago

This rule doesn't make sense with collection initialization. E.g. int[] array = [1, 2, 3, 4];

According to this rule, we should instead use int[] array =[1, 2, 3, 4]; or int[] array = { 1, 2, 3, 4 };

bjornhellander commented 2 months ago

This should go away if you switch to the latest beta.

bjornhellander commented 2 months ago

Duplicate of #3687

daleao commented 2 months ago

I am using Latest prerelease 1.2.0-beta.435.

bjornhellander commented 2 months ago

1.2.0-beta.556 is the latest. It's fixed in that.