Enforce code style rule IDE0055#21199
Conversation
This rule no longer appears to be buggy, so enforce it. Some of the automated fixes are adjusted in order to improve the result. #pragma directives have no option to control indentation, so remove them where possible.
c0e4744 to
f315506
Compare
| color, normals, shadow, 1f, | ||
| float3.Ones, TintModifiers.None) { } | ||
| float3.Ones, TintModifiers.None) | ||
| { } |
There was a problem hiding this comment.
This one I am not a big fan of. Is there anything we can do?
There was a problem hiding this comment.
having constructors be forced to have newline braces doesn't bother me
There was a problem hiding this comment.
The option csharp_preserve_single_line_blocks = true is allowing items that are wholly one one line such as Method(int a) { } to be preserved.
But as the parameters are already wrapped here, the csharp_new_line_before_open_brace = all option is jumping in to say the method body must be wrapped onto a new line.
There aren't any options to treat this differently that I can see. If you're not a fan of the style change, maybe consider if it is "acceptable losses" for enforcing the rule as a whole.
| public Activity MoveTo(CPos cell, int nearEnough = 0, Actor ignoreActor = null, | ||
| bool evaluateNearestMovableCell = false, Color? targetLineColor = null) { return null; } | ||
| bool evaluateNearestMovableCell = false, Color? targetLineColor = null) | ||
| { return null; } |
There was a problem hiding this comment.
Same here. Looked better before, although they should probably become lambdas already.
There was a problem hiding this comment.
Same issue as above.
There was a problem hiding this comment.
these braces should be unwrapped into 3 lines. Thought again this is TDGunboat, a hack trait already
penev92
left a comment
There was a problem hiding this comment.
I am not a big fan of some aspects of this rule, but I'll take it for the greater good, thank you 👍
Enforce IDE0055 Formatting rule https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0055
This rule no longer appears to be buggy, so enforce it. Some of the automated fixes are adjusted in order to improve the result.
#pragmadirectives have no option to control indentation, so remove them where possible.The default options are generally workable for us. We have a mix of existing styles for
csharp_indent_case_contents_when_block, but using the non-default results in a smaller diff.