Skip to content

SebastianBach/clang-format-generator

Repository files navigation

Clang Format Generator

build jobs

Command line tool that creates a clang-format file from a formatted C++ source code file.

See https://clang.llvm.org/docs/ClangFormat.html

Build

Requires a C++20 compiler.

mkdir build
cd build
cmake  ..
cmake --build . --config Release
ctest -C Release  -VV

Usage

Create the Reference Source File

Use the tool to create a reference source file:

clang_format_generator source_file.cpp

Format the Reference Source File

Format the generated source file as you like. Do not add or remove anything.

Create the clang-format File

Run the tool to parse the reference file and create the clang-format file. Specify the target version of clang-format.

clang_format_generator source_file.cpp .clang-format 160

Define the target version of clang-format as an integer. For example, use 160 for version 16.0.

About

Command line tool that creates a clang-format file from a formatted C++ source code file.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published