uncrustify: Can I configure it to completely reformat a line?

114 views Asked by At

When I use uncrustify to format lines of code like:

functionCall(quiteLongAndWordyArgument1, quiteLongAndWordyArgument2, quiteLongAndWordyArgument3,
             shortArgument);

functionCall(quiteLongAndWordyArgument1, quiteLongAndWordyArgument2, quiteLongAndWordyArgument3,
             shortArgument,
             anotherShortArgument);

It produces the following:

functionCall(quiteLongAndWordyArgument1, quiteLongAndWordyArgument2,
             quiteLongAndWordyArgument3,
             shortArgument);

functionCall(quiteLongAndWordyArgument1, quiteLongAndWordyArgument2,
             quiteLongAndWordyArgument3,
             shortArgument,
             anotherShortArgument);

Note that it's maintaining some of the existing newlines that are already there, rather than completely reformatting each chunk of code and fitting the arguments into as few lines as possible.

What I'd like it to do is treat those lines as though there's no newlines in it at all, so the result would be:

functionCall(quiteLongAndWordyArgument1, quiteLongAndWordyArgument2,
             quiteLongAndWordyArgument3, shortArgument);

functionCall(quiteLongAndWordyArgument1, quiteLongAndWordyArgument2,
             quiteLongAndWordyArgument3, shortArgument, anotherShortArgument);

Is this possible?

I've searched through uncrustify's massive number of configuration options and haven't found one that helps with this yet, though of course I could easily have missed one.

Here is my current configuration in case it helps.

0

There are 0 answers