drccrd commented on PR #4082:
URL:
https://github.com/apache/incubator-kie-tools/pull/4082#issuecomment-6976255202
There is some wierd formatting being produced in certain patterns. The
formatting is as intended for object constructors and methods, but doesn't
match normal java formatting for ifs and loops.
E.g.
```
if(
really long condition over 110 charachters to introduce a line fold bfore
the closing paren and the consequence
)
danglingUnbracedConsequence
```
and it looks even weirder with braces...
Suggestion:
for `if`, `else if`, `while`, `for`, `switch`, `catch`, `synchronized` and
the `} while( ... );` of a do-while:
1. Never break right after the opening (. The first operand stays on the if
line.
2. Break before top-level `&&`/`||`, with the operator starting the new line.
3. Indent continuation lines by two levels, so they can't line up with the
body at one level.
4. Keep the ) on the last line of the condition. A `{` follows on the same
line; an Allman `{` goes on the next line at the if's indent.
5. A call inside the condition that's still too long keeps today's call rule
(`)` on its own line), since it really is a call.
6. If the condition has no top-level `&&`/`||`, keep the `)` on the last
line and let inner calls break as calls
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]