Skip to content

Use clang-format for C++ code #2643

@daljit46

Description

@daljit46

I would like to suggest to use clang-format to format our C++ code. This will provide consistency and make the formatting of our C++ code uniform for all developers. We can enforce this by a simple CI check that ensures that new codes adhere to our chosen style. clang-format is available on all platforms and is supported by all major IDEs.

As for what formatting style we should use, clang-format provides 6 default styles: LLVM, Google, Chromium, Mozilla, WebKit or Microsoft. We should just pick one and stick with it (you can experiment with the different styles and options here). If we want to customise specific formatting rules we can, but we should try to stick with one of the defaults.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions