Do not force a blank line above method
See original GitHub issuePrint width: 100
Input code:
new TransactionTemplate().execute(new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(final TransactionStatus status) {
backupRepository.save(backup);
}
}
);
Expected output:
new TransactionTemplate().execute(
new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(final TransactionStatus status) {
backupRepository.save(backup);
}
}
);
Actual:
new TransactionTemplate()
.execute(
new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(final TransactionStatus status) {
backupRepository.save(backup);
}
}
);
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
coding style - empty lines in functions/methods - Stack Overflow
In short, empty lines in method body is a bad practice because a method should not contain "parts". A method should always do...
Read more >Blank lines (indent: Indent and Format C Program Source)
The -bap option forces a blank line after every procedure body. The -nbap option forces no such blank line. The -bbb option forces...
Read more >Codestyle, blank line after property declaration and before ...
After pressing [Ctrl]+[Alt]+[L] I get this: Question: How do I force the blank line to be there? I don't seem to find the...
Read more >WD2000: How to Create Ruling Lines or Blank Lines in Word
Under Preview, click on the diagram to select the bottom border, and then click OK. Blank Space Method. To underline one space at...
Read more >Handy one-liners for SED
Output file # should contain no more than one blank line between lines of text. sed ... to above sed '/regexp/d' # method...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It could be, but the goal of prettier is to (as much as possible) provide a single, opinionated style rather than supporting every possible formatting preference https://prettier.io/docs/en/option-philosophy.html
Yep, sorry if my wording wasn’t clear. I was trying to express that there should be a newline between
methodOne
andmethodTwo
, not necessarily between the class declaration andmethodOne
. Maybe “consecutive method declarations” would have been more clear.Forcing a newline between class declaration and the first method declaration happens to be my preference (especially if there is an annotation present on the method), but I understand this is probably going to be divisive