Closed tfliao closed 5 years ago
For such special cases, it is simply best to instruct clang to not indent that block of code:
/* clang-format off */
...The Code...
/* clang-format on */
There is absolutely no way how you can teach an AST pretty printer to get that particular piece of code indented the way you want.
Never skip format check at first glance.
Unify coding style is good, but sometimes the style doesn't match the running style of editing file, or something else. It will be good if we allow programmer to use their judgement on this topic.
for example, I created an array of struct attribute for my attribute_group, but clang-format think all attributes should be declared in single line.