Let be the file Version.h.in that we will "configure" in CMake :
configure_file("Version.h.in" "${CMAKE_CURRENT_BINARY_DIR}/Version.h" @ONLY)
In this file I have CMake variables such as :
#define HELLO_VERSION_MAJOR @VERSION_MAJOR@
And clang-format puts a space before the last '@' :
#define HELLO_VERSION_MAJOR @VERSION_MAJOR @
What rule should I modify to prevent this ?
clang-format can be told to skip code like this:
int formatted_code;
// clang-format off
void unformatted_code ;
// clang-format on
void formatted_code_again;
This was added atleast 6 months ago. multi-line comments can be used too (and that way only a part of a line can be skipped)
int /* clang-format off */ a /* clang-format on */ = 5;
see this for more options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With