Reputation: 1288
I'm trying to figure out if I can use clang-format to automatically format the code for my project. We have a coding style which enforces newlines after the function return type (but only in the definition, not in the declaration). I'd like to encode this in clang-format.
IOW, I want this:
uint32_t
my_function(uint32_t input)
{
return 0;
}
Not this:
uint32_t my_function(uint32_t input)
{
return 0;
}
Upvotes: 7
Views: 8483
Reputation: 742
AlwaysBreakAfterDefinitionReturnType(DRTBS_All) If you add that to the .clang-format file that contains all your formatting decisions it should do exactly what you want.
Upvotes: 12