-
Notifications
You must be signed in to change notification settings - Fork 91
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
Support C/C++ formating from Eclipse CDT #265
Comments
I think this would be useful, but it would probably have to run outside of a Maven project, since most C/C++ projects don't use Maven to build. Running outside of a Maven project is being discussed as problematic on #261 , but it may be possible to create a separate mojo for formatting C/C++ code outside of a project. |
I did some job on embedding Eclipse CDT into fromatter-maven-plgin. Some commits are available in my cdt_#265 branch. There are some issues with Eclipse CDT formatter:
I have prepared unit tests to cover some specific cases. I didn't create a separate mojo for C/C++ formatting, I just added this to a FormatterMojo. I have checked this and it works with my C/C++ code. I know that most C/C++ projects doesn't use Maven to build. Maybe it could be used together with nar-maven-plugin. |
@wmarkow It sounds like you've made some good progress. I think before this would be ready for a pull request, I'd want to see the relevant CDT jars for formatting be published to Maven Central, and for it to better support formatting outside of an Eclipse CDT project. |
It would be good to format C/C++ code as well. Eclipse CDT can be used as a C/C++ development IDE. It has already a formatter that seems to work in a similar way like for standard Java development.
I think it could use the CodeFormatter class from org.eclipse.cdt.core jar. At the beginning it could format the following files:
With this solution it would be possible to format a large C/C++ project pretty fast. Let me know what you think.
The text was updated successfully, but these errors were encountered: