We would like to make our C ++ fit style more consistent. Right now, our code contains a combination of:
if (cond) { // ... } else { // ... }
... and:
if (cond) { // ... } else { // ... }
We want to use only the latest style.
However, we do not want to indent our code. I tried using astyle, bcpp, GNU indent and Uncrustify (and I examined command line options for GreatCode). Unfortunately, each of these tools insists on re-encoding our code, and most of them strongly block the C ++ constructor constructor initializer lists and preprocessor macros.
Are there any C ++ code constructors that can fix curly braces, leaving only indentation? It doesn't have to be an existing tool - if you know how to do it using some crazy single-line Perl, that's good too. Thanks!
Update: Yes, we know that this will make it difficult to read diff against old code. This is a long-term code cleanup, and we decided that the day-to-day benefits of consistent formatting outweigh any version control difficulties.
c ++ coding-style formatting indentation curly-braces
emk
source share