Is there an option for clang-format to add braces to all if()/do/while statements etc?
eg
if( i == 42 )
std::cout << "You found the meaning of life
";
else
std::cout << "Wrong!
";
to
if( i == 42 )
{
std::cout << "You found the meaning of life
";
}
else
{
std::cout << "Wrong!
";
}
Using
$ clang-format --version
clang-format version 3.6.0
See Question&Answers more detail:os