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

Feature Request: remove line before the content of a bracketless if/else statement #979

Closed
Infinite-3D opened this issue Oct 29, 2023 · 1 comment · Fixed by #980
Closed
Labels
Milestone

Comments

@Infinite-3D
Copy link

In my opinion, code like this

if (condition)
    
    doSomething();
else

    doSomethingElse();

for (int i = 0; i < 10; i++)

    total += i;

should be formatted as

if (condition)
    doSomething();
else
    doSomethingElse();

for (int i = 0; i < 10; i++)
    total += i;
@belav
Copy link
Owner

belav commented Oct 30, 2023

Agreed! It removes those lines if there are braces, and I can't see why anyone would want them there.

@belav belav added this to the 0.26.0 milestone Oct 30, 2023
@belav belav added type:enhancement New feature or request area:formatting labels Oct 30, 2023
shocklateboy92 pushed a commit that referenced this issue Nov 1, 2023
* Remove empty lines at beginning of statements without braces

closes #979

* formatting files

* try again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants