Repository navigation
Indent the whole statement when the SA1503, SA1519 and SA1520 code fix adds braces - #4108
Merged
AArnott merged 5 commits intoOct 7, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4108 +/- ##
==========================================
- Coverage 97.48% 97.48% -0.01%
==========================================
Files 1026 1032 +6
Lines 119387 119800 +413
Branches 3476 3494 +18
==========================================
+ Hits 116388 116789 +401
- Misses 1986 1996 +10
- Partials 1013 1015 +2 🚀 New features to boost your workflow:
|
AArnott
marked this pull request as ready for review
October 7, 2026 18:14
This was referenced Nov 11, 2026
Bump StyleCop.Analyzers from 1.2.0-beta.556 to 1.3.180
microsoftgraph/aspnetcore-webhooks-sample#436
Open
Closed
This was referenced Nov 23, 2026
Open
[DPDBT] Bump Microsoft.CodeAnalysis.Analyzers and 6 others
sergey-rybalkin/CommandLine.Generators#63
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the shared add-braces code fix (SA1503, SA1519, SA1520) wraps a statement that starts at its parent's indentation, every line of the statement now moves one indentation step. Before, only the first line moved, so nested
usingstatements got their braces at the outer level. Indentation settings are respected, verbatim string contents are unchanged, and Fix All on nested statements does not double-indent.The line indenter from the SA1116 fix moves to
IndentationHelperand is shared. Depends on #4107: this branch contains its commit; the diff of this PR is the second commit.Tests: four new SA1519 tests; two existing tests expected the broken layout and now expect the nested form. StyleCop.Analyzers.Test (net6.0) passes.
Fixes #2183
Ported from the StyleCopNext.Analyzers fork (see alexander-efremov#564). Draft until CI on this repository is running again.