/black-cpp

Black-inspired C++ code style for Clang Format

Primary LanguageC++

Black-inspired C++ code style for Clang Format

black-cpp adapts the Black code style for C++ using Clang Format.

Black is a popular opinionated formatter for Python: Black makes code review faster by producing the smallest diffs possible.

// dangling parantheses
int very_long_function_signature(
    int first_param,
    float second_param,
    double third_param,
    const std::vector<int>& numbers
) {
    return 1;
}

Usage

  1. Copy the .clang-format configuration file to the root directory of your project.
  2. Install Clang Format, at least version 14.
  3. Run Clang Format with clang-format -i <file> or use one of the numerous IDE plugins:

Discussions