Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/139.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 在if、for和while语句之前和之后使用clang格式添加换行符(相当于Astyle——断块)_C++_C_Llvm_Clang Format - Fatal编程技术网

C++ 在if、for和while语句之前和之后使用clang格式添加换行符(相当于Astyle——断块)

C++ 在if、for和while语句之前和之后使用clang格式添加换行符(相当于Astyle——断块),c++,c,llvm,clang-format,C++,C,Llvm,Clang Format,我一直在使用Linux内核存储库中提供的clangformat样式,我想根据自己的需要对其进行调整。我试图在if、for和while块前后添加一个换行符 虽然我从未使用过Astyle,但它通过--break blocks Astyle文档中的一个示例 isFoo = true; if (isFoo) { bar(); } else { anotherBar(); } isBar = false; 变成: isFoo = true; if (isFoo) { bar()

我一直在使用Linux内核存储库中提供的
clangformat
样式,我想根据自己的需要对其进行调整。我试图在if、for和while块前后添加一个换行符

虽然我从未使用过Astyle,但它通过
--break blocks

Astyle文档中的一个示例

isFoo = true;
if (isFoo) {
    bar();
} else {
    anotherBar();
}
isBar = false;
变成:

isFoo = true;

if (isFoo) {
    bar();
} else {
    anotherBar();
}

isBar = false;
我搜索了
clangformat
的文档,但找不到可以实现相同样式的标志

有没有一种方法可以使用
clangformat
实现这种风格