I'm trying to clean up my C codebase using clang-format (version 3.8.) on Ubuntu 14.04. As a requirement I need clang-format to maintain (or better enforce) the indentation of multiple successive declarations/definitions. For example:
void foo()
{
int a;
float b;
myLongType c;
}
After running clang-format I get the following output:
void foo()
{
int a;
float b;
myLongType c;
}
Is there an option that I'm not aware of to keep/enforce this formatting?
If this is not possible, is it possible to extend the functionality of clang-format locally (as it is with clang-tidy?) or do I have to open a feature request?
I know that this kind of formatting is mostly used in C code bases, and although the help message states "A tool to format C/C++/Java/...", all the options seem to be mainly targeted to C++.
Just overread the correct option. From Clang Format Options website: