Skip to content

fix(pretty-printer): format empty blocks without extra empty line - #1346

Merged
anton-trunov merged 3 commits into
mainfrom
pmakhev/empty-statement-block-formatting
Jan 16, 2025
Merged

anton-trunov merged 3 commits into
mainfrom
pmakhev/empty-statement-block-formatting

Conversation

@i582

@i582 i582 commented Jan 16, 2025

Copy link
Copy Markdown
Contributor

With this PR the following code:

fun foo() {

}

will be formatted as:

fun foo() { }

Issue

Closes #1039.

Checklist

  • I have updated CHANGELOG.md
  • I have added tests to demonstrate the contribution is correctly implemented: this usually includes both positive and negative tests, showing the happy path(s) and featuring intentionally broken cases
  • I have run all the tests locally and no test failure was reported
  • I have run the linter, formatter and spellchecker
  • I did not do unrelated and/or undiscussed refactorings

@i582
i582 requested a review from a team as a code owner January 16, 2025 07:53
@anton-trunov

Copy link
Copy Markdown
Contributor

Let's add one space character between the curly braces { }. Editor insert pairs of curly braces automatically, so I usually add one to indicate I haven't forgotten to put statements between the braces.

@i582

i582 commented Jan 16, 2025

Copy link
Copy Markdown
Contributor Author

Let's add one space character between the curly braces { }. Editor insert pairs of curly braces automatically, so I usually add one to indicate I haven't forgotten to put statements between the braces.

Done

@anton-trunov
anton-trunov merged commit 4747594 into main Jan 16, 2025
@anton-trunov
anton-trunov deleted the pmakhev/empty-statement-block-formatting branch January 16, 2025 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty statement blocks have extraneous empty line

2 participants