csharpier
csharpier copied to clipboard
BinaryExpression - Possibly change the way parens are formatted
Currently csharpier formats this way
if (
string.Equals(
node.BoundAttribute.TypeName,
ModelExpressionTypeName,
StringComparison.Ordinal
)
|| (
node.IsIndexerNameMatch
&& string.Equals(
node.BoundAttribute.IndexerTypeName,
ModelExpressionTypeName,
StringComparison.Ordinal
)
)
) { }
Prettier formats the same thing this way
if (
string.Equals(
node.BoundAttribute.TypeName,
ModelExpressionTypeName,
StringComparison.Ordinal
) ||
(node.IsIndexerNameMatch &&
string.Equals(
node.BoundAttribute.IndexerTypeName,
ModelExpressionTypeName,
StringComparison.Ordinal
))
) {
}
Should csharpier do something similar? The prettier method doesn't seem consistent with other parens that are formatted, but it does keep the line count down.
Another example
var x =
(
cbPasswordBuffer
|| Constants.MAX_STACKALLOC_BYTES_____________________________________________
)
&& true;
Another example
if (
(
resourceClients.Length == 1
&& resourceClients[0]
== ApplicationProfilesPropertyValues.AllowAllApplications
)
|| resourceClients.Contains(client.ClientId)
) {
client.AllowedScopes.Add(identityResource.Name);
}
I think I prefer the way csharpier does things currently. The parentheses and line breaks seem more logical and readable that way, which I'd personally prioritize over (within reason) line savings.