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 -VVUse the tool to create a reference source file:
clang_format_generator source_file.cppFormat 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 160Define the target version of clang-format as an integer. For example, use 160 for version 16.0.