Skip to content

Use clang-format to enforce code conventions #1012

Closed
@arturo182

Description

@arturo182

As @tannewt mentioned in another issue, this would make sure that all code is uniformly formatted.
So let's have a discussion about how to implement this and which code style to use.

For the implementation we should run it as a part of the Travis CI for each PR for sure, but is there a way to run it also on users' computers before they commit. It can be done with pre-commit git hooks but those need to be setup manually by each user which is not great.

As for the code style, we can either use a predefined format or make our own, more info here: https://clang.llvm.org/docs/ClangFormatStyleOptions.html

Thirdly, the Code Conventions link in https://github.com/adafruit/circuitpython/blob/master/CONTRIBUTING.md links to the micropython file, as it seems we don't have one in our repository, should we copy it locally, change the link and eventually modify the style to match our decisions?

And lastly, to what extent should the clang-format be applied, don't think we can expect all of the C code to be properly formatted, should it only be shared-bindings, shared-modules and the nrf and samd ports, or more?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions