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/C++ support #232

Closed
fvgh opened this issue Apr 4, 2018 · 5 comments
Closed

C/C++ support #232

fvgh opened this issue Apr 4, 2018 · 5 comments
Assignees

Comments

@fvgh
Copy link
Member

fvgh commented Apr 4, 2018

I would like to provide C/C++ formatting support.
The following features shall be initially provided:

  • C/C++ formatter based on CDT (see Provision of Spotless Eclipse CDT formatter plugin. #231)
  • Include order changes based on existing code for ImportOrderStep
  • Extension for Gradle/Maven whereas Maven will use default file name extensions and Gradle probably the native-specs (have to do some reading first...)
@fvgh fvgh self-assigned this Aug 29, 2018
@fvgh
Copy link
Member Author

fvgh commented Aug 29, 2018

I provided an example use case. Feedback is welcome.

@fvgh fvgh mentioned this issue Sep 4, 2018
@fvgh
Copy link
Member Author

fvgh commented Sep 15, 2018

Formatting accomplished with #295.
Sorting of include statements still to be supported. Usage of ImportOrderStep is not a suitable option. CDT offers a highly configurable solution. Aiming to integrate CDT include-organizer.
Hence this issue remains open.

@fvgh
Copy link
Member Author

fvgh commented Mar 30, 2019

The usage of IncludeOrganizer as it is provided by CDT is not an option.

  • The amount of dependencies on other Eclipse components is quite high.
  • Only a very small set of options is supported without pre-knowledge of the project setup (knowledge which headers belong to other libraries). Unfortunately even the header substitution is not applied.
  • The results differ for the same configuration depending whether it is run with a project or without. This cannot be easily worked-around.

All in all it seems a better idea to implement an own organizer similar to the Spotless Java Import sorter.

@nedtwigg
Copy link
Member

nedtwigg commented Jul 2, 2020

I try to keep the issues in-sync with our releases, but I missed this one! We have had C/C++ support since:

It seems like a missing piece is an include organizer. One option is to build one from scratch, another would be to use clang-format (#475), and follow it up with eclipseCdt(). Regardless, even without include organizing, it's tremendously valuable to have Eclipse CDT's autoformatter included, thanks so much @fvgh! I'm going to close this as "long-ago implemented", and if you have a specific unmet need, feel free to open a new issue.

@nedtwigg nedtwigg closed this as completed Jul 2, 2020
@nedtwigg
Copy link
Member

nedtwigg commented Aug 25, 2020

As of plugin-gradle 5.2.0 we also support clang-format. PR for maven welcome :)

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

No branches or pull requests

2 participants