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

Support for clang format. #21

Open
weisJ opened this issue Aug 2, 2020 · 6 comments
Open

Support for clang format. #21

weisJ opened this issue Aug 2, 2020 · 6 comments

Comments

@weisJ
Copy link
Contributor

weisJ commented Aug 2, 2020

The eclipse CDT formatted hasn’t been up to the standard of newer c++ versions for some time. e.g it has a hard time to parse angles brackets around template arguments, mistaking them as comparison operators.

It would be great to be able to use the clang formatted instead, as it is a lot better at parsing newer c++ code.

@weisJ
Copy link
Contributor Author

weisJ commented Aug 12, 2020

If you can give me the workflow of how the program provisioning for the eclipse formatter works I could work on a PR for this feature.

@vlsi
Copy link
Member

vlsi commented Aug 12, 2020

I guess Eclipse formatter is a Java program, so the provisioning is easier there.
Do you intend to update Eclipse formatted or implement a clang-based one?

@weisJ
Copy link
Contributor Author

weisJ commented Aug 12, 2020

The eclipse CDT formatter isn't up to date with the newer versions of c++ in its parsing (It actually isn't even fully for older versions) so updating the eclipse format would basically involve fixing the whole parsing of the CDT formatter. I'll have to look whether it is possible to to provisioning for clang-format. Otherwise the user would have to provide the installation. While not ideal it would still be a good addition.

@vlsi
Copy link
Member

vlsi commented Aug 12, 2020

Ah, ok.

I see there's npm-packaged clang-format: https://www.npmjs.com/package/clang-format which seems to be implemented for multiple platforms.

I do not see existing clang-format artifacts on Central.

So the options could be:
a) Reuse binaries from npmjs (== download "npm package, and extract binary out of it").
NPM URL is https://registry.npmjs.org/clang-format/-/clang-format-1.4.0.tgz (it looks like a snapshot of Git repository: https://github.com/angular/clang-format), so we could even fetch binaries from URLs like https://github.com/angular/clang-format/blob/869205766d4e9746db8546af2f1292df80678995/bin/win32/clang-format.exe
b) Publish clang-format binaries to Central. The releases are not that often, so we could probably do it manually (or even wrap angular/clang-format in Maven jars).
c) Ask users to install the binaries somehow

@vlsi
Copy link
Member

vlsi commented Aug 12, 2020

However, publishing to Central is preferred as it would work better when building with limited internet connectivity (e.g. when corporate proxies are used)

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

No branches or pull requests

2 participants