-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Use clang-format for code formatting #1598
Conversation
For fixing I used clang-format -i -style=Google **/*.h && clang-format -i -style=Google **/*.cpp clang-format 6.0.0
Why is https://github.com/stweil/tesseract/tree/format different? |
#1598 is using clang-format 6.0.0 https://github.com/stweil/tesseract/tree/format is formatted using |
I now created https://github.com/stweil/tesseract/tree/clang-format-6 with clang-format 6.0.0-3. The result is identical to that from clang-format 7.0.0 (that means not the same as https://github.com/ZaMaZaN4iK/tesseract/tree/fix_format). It needs three iterations to stabilize. The formatting was done on Debian Buster. |
Run with clang 5 and 6/7:
Do you get the same result? |
Appveyor failed. |
Appveyor fails in my four tests, too. stweil@4ee0fdc shows the dumped configurations. |
The Google style does not say whether |
👍
It seems that Ray prefers |
@amitdo I also prefer |
I think we should dump existing one format profile (suggest use Google code style), correct it a little bit and push to Tesseract repo |
https://github.com/stweil/tesseract/tree/format now uses uniform left aligned pointers and also includes a |
We still have to decide when to do the formatting with clang-format. Should we do it before or after 4.0.0? |
If yes, than we should do it before 4.0 release. |
it is good |
@zamazan4ik , @stweil : Can be this PR fixed / replaced / closed this week? |
Yes, it can be closed. I think we won't reformat the whole code for 4.0.0. |
I suggest to re-format the whole codebase for 5.0.0. |
First step - reformat all headers in 'include/tesseract'. |
For fixing I used clang-format -i -style=Google **/.h && clang-format -i -style=Google **/.cpp
clang-format 6.0.0
In this PR I suggest to discuss about code-style for Tesseract. Because FMPOV Google style isn't ideal for Tesseract and we can add some Tesseract-specific options.