In my project (C/C++) I use slightly modified formatting from eclipse default formatter (bsd/allman + spaces over tabs).
I would like to switch the editor, and to do so, I have to have correct formatter.
Is there a way to convert .xml
file with formatting exported from eclipse, to .clang-format
file ?
I aim to have exactly the same formatting, and I do not want to reformat the project, just because I switched the editor
Optionally, is there a way to use eclipse formatter in vscode for C/C++ projects?
I realized, that the project did not have checking of formatting in CI, and when I run any formatter it had massive changes, so In my organization, I forced everyone to adapt clang format, and I added checks to the CI.
This solved my issue, but during my investigation I found that not all options can be moved to other formatting tools (who would have thought), so changing formatter will almost always need some reformatting.
I found that it is possible to run eclipse formatter standalone (I don't have any reference, so if you are interested, than you need to look for it), I could not get this to work tho.
In summary if you can, avoid changing formatters because some options may not be available. And I would suggest using tools that can be easily used standalone (clang-format).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With