You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From my testing, it seems like a difference of just two characters can result in the 3 formats below, regardless of the indentation level. I am on board with trying to eliminate the second option. I may actually have an issue about this already.
if (somelongstatement == true || someOtherStatement_______________________________________ == false)
{
// do thing
}
if (
somelongstatement == true || someOtherStatement________________________________________ == false
)
{
// do thing
}
if (
somelongstatement == true
|| someOtherStatement_________________________________________ == false
)
{
// do thing
}
Splitting lines not solely on the width but also on width + logical separators makes the code more readable (subjectively).
Example
Example code with logical checks, just exceeding a 100-character config limit.
Original Line, 103 char long. Over the 100-char config limit.
When formatted ends up like the following, 97 char long at the widest, under the 100-char config limit.
In my opinion, this would look better by either keeping it at 103 and not breaking or, preferably, breaking it further like so:
Currently, the last example will be formatted back to the middle example.
The text was updated successfully, but these errors were encountered: