Use clang-format for Extension Modules #28143
Labels
Code Style
Code style, linting, code_checks
Needs Discussion
Requires discussion from core team before further action
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 theseIn 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
The text was updated successfully, but these errors were encountered: