I've just started playing with uncrustify, and I'm trying to get my
configuration file set up so it formats mostly according to FreeBSD
style. It's done a few things "wrong" that I'm not quite sure how to
Attached is my config file and an example program (the config file is
60k; hopefully the attachment won't be stripped). The things of
interest at the moment, when diffing the source and the uncrustified
1) Uncrustify uses spaces in a multi-line macro to line up the '\'
instead of tabs, so it completely reformatted the VERIFY_ASSERT macro.
2) the while (0) in the VERIFY_ASSERT macro is no longer cuddled with
the closing brace.
3) The second parameter to the VERIFY_ASSERT macro, when it's just a
comment, is indented by 2 tabs instead of as a normal continuation
4) I want uncrustify to remove trailing returns when they're
redundant, but in the case of the subroutine() it's needed to prevent
a compilation error:
ex.u.c: In function ‘subroutine’:
ex.u.c:27: error: label at end of compound statement
5) I have my emacs auto-indent set up to indent goto labels to the
same indentation level as the line normally would be (via tabs) then
add an extra space. I can probably live with goto labels always being
in column 1, but I don't recall seeing an option for this.
6) The continuation lines inside a switch() statement seem to be
indented by a full extra tab, rather than 4 spaces as I thought it
There's other things I'd like to be able to configure that I didn't
see knobs for, so hopefully I'll be submitting patches soon. But I
wanted to be sure I understood the existing options first, and the
attached example is a condensing of some changes I saw on some real
source files at work that weren't reformatted as I expected.