Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Jan 16, 2025

Conversation

i582
Copy link
Contributor

@i582 i582 commented Jan 16, 2025

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
Member

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
Copy link
Contributor Author

i582 commented Jan 16, 2025

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
17 checks passed
@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