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

Add option to enforce braces in If/for/while/.. code blocks #1016

Closed
trufae opened this issue Feb 10, 2017 · 5 comments
Closed

Add option to enforce braces in If/for/while/.. code blocks #1016

trufae opened this issue Feb 10, 2017 · 5 comments

Comments

@trufae
Copy link

trufae commented Feb 10, 2017

input:

int main(int argc) {
if (argc> 2) printf ("Winrar\n");
}

expected output:

int main(int argc) {
    if (argc > 2) {
      printf ("Winrar\n");
   }
}
@CDanU
Copy link
Collaborator

CDanU commented Feb 10, 2017

Try:

mod_full_brace_do
mod_full_brace_for
mod_full_brace_function
mod_full_brace_if
mod_full_brace_if_chain
mod_full_brace_if_chain_only
mod_full_brace_if_chain
mod_full_brace_nl
mod_full_brace_while
mod_full_brace_using

@trufae
Copy link
Author

trufae commented Feb 10, 2017 via email

@CDanU
Copy link
Collaborator

CDanU commented Feb 10, 2017

To get exactly your expected result:

# Uncrustify 0.64.414-g06cfd174
nl_if_brace                     = remove
mod_full_brace_if               = force
# option(s) with 'not default' value: 2
#

Input

int main(int argc) {
if (argc> 2) printf ("Winrar\n");
}

Output

int main(int argc) {
	if (argc> 2) {
		printf ("Winrar\n");
	}
}

If that still does not work read and do what is stated in the ISSUE_TEMPLATE

@trufae
Copy link
Author

trufae commented Feb 10, 2017 via email

@trufae
Copy link
Author

trufae commented Feb 10, 2017

nvm. that works! thanks!

@trufae trufae closed this as completed Feb 10, 2017
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

No branches or pull requests

2 participants