clang-format是否有选项可以为所有if()/do/while语句等添加大括号?
例如:
if( i == 42 )
std::cout << "You found the meaning of life\n";
else
std::cout << "Wrong!\n";
到
if( i == 42 )
{
std::cout << "You found the meaning of life\n";
}
else
{
std::cout << "Wrong!\n";
}
使用
$ clang-format --version
clang-format version 3.6.0