Command line tool that creates a clang-format
file from a formatted C++ source code file.
See https://clang.llvm.org/docs/ClangFormat.html
Requires a C++20
compiler.
mkdir build
cd build
cmake ..
cmake --build . --config Release
ctest -C Release -VV
Use the tool to create a reference source file:
clang_format_generator source_file.cpp
Format the generated source file as you like. Do not add or remove anything.
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.