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

Code formatting #72

Open
Rubo3 opened this issue Jan 26, 2022 · 2 comments
Open

Code formatting #72

Rubo3 opened this issue Jan 26, 2022 · 2 comments

Comments

@Rubo3
Copy link
Contributor

Rubo3 commented Jan 26, 2022

Have you thought about using a code formatter like astyle or uncrustify? It's good to have a consistent style.

@jpbruyere
Copy link
Owner

That you be great, I like to follow the same formatting rules.

@Rubo3
Copy link
Contributor Author

Rubo3 commented Jan 26, 2022

Great! I was playing with astyle, it's dead easy to use, I ran:

astyle --style=google --attach-closing-while --indent-preproc-block --indent-preproc-define --indent-col1-comments --pad-oper --pad-comma --pad-header --unpad-paren --align-reference=name --break-one-line-headers --remove-braces --break-return-type --break-return-type-decl --convert-tabs --remove-comment-prefix --max-code-length=100 --break-after-logical < vkvg_context.c > vkvg_context_beautified.c

and this is the result: vkvg_context_beautified.txt.
Not bad, but it could be better. On the other hand, uncrustify has many more options, but the documentation is very minimal.
You can take some time to try some configurations and then decide which one you like more.

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