Skip to content

Use clang-format for Extension Modules #28143

Closed
@WillAyd

Description

@WillAyd

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Code StyleCode style, linting, code_checksNeeds DiscussionRequires discussion from core team before further action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions