Skip to content
New issue

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

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

Already on GitHub? # to your account

any way to automatically add braces for single line statement? #56

Open
fyears opened this issue Aug 15, 2016 · 1 comment
Open

any way to automatically add braces for single line statement? #56

fyears opened this issue Aug 15, 2016 · 1 comment

Comments

@fyears
Copy link

fyears commented Aug 15, 2016

Any way to automatically add braces for single line code inside if or something like that?

For the source code like this:

if (TRUE)
  a = 1
b = 2

Current default result for tidy_source():

if (TRUE) a = 1
b = 2

Expected formatted result (of the requested feature):

if (TRUE) {
  a = 1
}
b = 2
@yihui
Copy link
Owner

yihui commented Aug 15, 2016

Nope, but if you can figure out how to implement it, I'd be glad to take a look at your pull request :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants