是否可以选择 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