Fix SA1509 getting reported for consecutive blocks#702
Fix SA1509 getting reported for consecutive blocks#702sharwell merged 4 commits intoDotNetAnalyzers:masterfrom
Conversation
|
What should happen with the code below? I think it will report SA1509, but I think it should not report any diagnostic. class Foo
{
void Bar()
{
/* test comment */
{
}
{
}
}
}"; |
|
I still claim it should raise SA1509 for first nested block in both cases: class Foo
{
void Bar()
{
/* test comment */
{
}
{
}
}
}";and class Foo
{
void Bar()
{
// test comment
{
}
{
}
}
}"; |
|
And also for: class Foo
{
void Bar()
{
#region Test region
{
}
{
}
#endregion
}
}"; |
|
@vweijsters The current code reports SA1509 in that case, and this pull request does not change that. Since that line is not between blocks, it's also outside the scope of this particular issue; you can file a new issue if you'd like to see the behavior in that case changed. @Przemyslaw-W I added unit tests to verify that the behavior of this pull request adheres to your expectations. |
Current coverage is
|
|
The docs should reflect the behavior. |
At the same time, the implementation of the new behavior was greatly simplified.
|
👍 |
Fix SA1509 getting reported for consecutive blocks
Fixes #689