Skip to content

Using Clang-Format for Automatic Source Code Formatting #71

Closed
@pratikpc

Description

@pratikpc

In many portions of the Library we find that an inconsistent C++ Code formatting style is followed.
For example, certain places have

  1. Different Tab Sizes
  2. Different Brace Styles(Allman vs 1TBS/K&R/Stroustrup)

We could use an Automatic Source Formatter to rectify such issues.
While I would recommend Clang-Format, AStyle also exists

We could create a configuration file and define the properties.
For a sample Clang-Format configuration, see this
We could decide on what the properties would be here.

To simplify our tasks and reduce the conflicts that come with the question, Clang-Format also provides a few default styles like:-

  1. LLVM
  2. Google
  3. Chromium
  4. Mozilla
  5. WebKit

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