question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do not force a blank line above method

See original GitHub issue

Print 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:open
  • Created 4 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
jhabercommented, Mar 26, 2020

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

2reactions
jhabercommented, Oct 15, 2019
  • separate method declarations, excluding if the method is the first element in class body

Yep, sorry if my wording wasn’t clear. I was trying to express that there should be a newline between methodOne and methodTwo, not necessarily between the class declaration and methodOne. 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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found