8 # Remove optional braces of control statements (if, else, for, and while)
9 # according to the LLVM coding style. This avoids braces on simple
10 # single-statement bodies of statements but keeps braces if one side of
11 # if/else if/.../else cascade has multi-statement body.
13 # As this rule comes with a warning [1], we want to experiment with it
14 # before adding it in-tree. since the CI job for the style check is allowed
15 # to fail, appending the rule here allows us to validate its efficacy.
16 # While also ensuring that end-users are not affected directly.
18 # [1]: https://clang.llvm.org/docs/ClangFormatStyleOptions.html#removebracesllvm
21 echo "RemoveBracesLLVM: true"
22 } >/tmp
/clang-format-rules
24 git clang-format
--style=file:/tmp
/clang-format-rules \
25 --diff --extensions c
,h
"$baseCommit"