Skip to content

Use clang-format for Extension Modules #28143

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

Closed
WillAyd opened this issue Aug 25, 2019 · 1 comment
Closed

Use clang-format for Extension Modules #28143

WillAyd opened this issue Aug 25, 2019 · 1 comment
Labels
Code Style Code style, linting, code_checks Needs Discussion Requires discussion from core team before further action

Comments

@WillAyd
Copy link
Member

WillAyd commented Aug 25, 2019

Right now we use cpplint for header files only. Unfortunately this leaves some of our extension module implementations rather sloppy.

We could extend cpplint to those but from what I have seen it doesn't have an opinion on indentation, which coming from a Python perspective could be useful. It also not surprisingly focuses more on C++ which isn't applicable to our extensions

As an alternate I'd propose taking a look at the clang-format tool. I'll push up a PR for review to give an idea of diff. gnu indent is also an option though I'm not sure if that's available to Windows devs that may want to work on these

In either case a CI code check could be added simply using a rule like this:

https://stackoverflow.com/questions/22866609/can-clang-format-tell-me-if-formatting-changes-are-necessary#comment63404587_22866610

@WillAyd WillAyd added the Code Style Code style, linting, code_checks label Aug 25, 2019
@simonjayhawkins simonjayhawkins added the Needs Discussion Requires discussion from core team before further action label Dec 11, 2019
@jbrockmendel
Copy link
Member

go for it

@WillAyd WillAyd closed this as completed Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks Needs Discussion Requires discussion from core team before further action
Projects
None yet
Development

No branches or pull requests

3 participants