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

c++ code auto-formatting template/tool needed #481

Open
AquariusPower opened this issue Aug 29, 2018 · 3 comments
Open

c++ code auto-formatting template/tool needed #481

AquariusPower opened this issue Aug 29, 2018 · 3 comments
Labels
Building compiling, etc.

Comments

@AquariusPower
Copy link
Contributor

AquariusPower commented Aug 29, 2018

#478 (comment)

basically, we dont need to code in a new style we are not used to
as long we have a good auto-formatter template (create one on EclipseIDE or some command line that runs in all OSs to be run just b4 cmake)

of course, after auto-formatted, changing some parts back to personal stile will be replaced later by the auto-formatter :)

@jakwings
Copy link
Member

I'm definitely not a good C/C++ programmer. I see people use "astyle" or "clang-format". The former require less dependencies and is easier to install.

@AquariusPower
Copy link
Contributor Author

AquariusPower commented Aug 31, 2018

nice thx!
I think we should use clang-format by the reasons here https://stackoverflow.com/a/841083/1422630
and it can be run automatically on the command line too!

EDIT: I tried some existing styles but didnt like much them (of course, that is a preference thing), ran like:
clang-format -i -style=Google cmdcraft.cpp
anyway, I believe that copying from some existing style and tweaking it could be the best option.
btw, the worst thing I found on the styles seem to be the restriction of the line's width, apparently 80 columns, we dont really need it nowadays (just another opinion anyway xD)

@emlai
Copy link
Contributor

emlai commented Dec 21, 2018

+1 for clang-format. I think it's the way to go nowadays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Building compiling, etc.
Projects
None yet
Development

No branches or pull requests

4 participants