The important thing is that we get something smarter than mixed single-space tab 4-space 8-space indentation with irregular windows/linux endings.
ASTYLE_PARAMETERS_CPP="--style=1tbs \
--indent=spaces=4 \
--indent-classes \
--indent-switches \
--indent-namespaces \
--indent-preprocessor \
--indent-labels \
--indent-col1-comments \
--unpad-paren \
--keep-one-line-blocks \
--keep-one-line-statements \
--lineend=linux \
--suffix=none"
#ASTYLE_PARAMETERS_H=...
#ASTYLE_PARAMETERS_JSON=...
I’ve been avoiding this because I knew I’d have to go through all the astyle options and spend some time considering them, here are my preferences for cpp/h. I’ll need to take a closer look at json, though 2-space is probably sensible.
–style=1tbs // Yes, this is not what we’re currently using, Allman was a compromise IIRC
–indent-spaces=4 //tellingly, leaving this off defaults to 4-space indention :3
–align-pointer=name // I’m more used to =name, I don’t think =type would be a huge problem, but I do want to pick one or the other.
–max-code-length=100
–break-after-logical
I’d be very curious to hear why anyone would not want these (indention of switch statements is weird, and I’d not be surprised about disagreement of them in particular).
–indent-all-the-things
–pad-oper
–add-brackets
There is contention about this, but AFAIK there is total consensus amoung the main devs about it, so arguing about it is pretty poitless.
–convert-tabs
I think paren padding can and should be left to the author, for emphasis. Also if there is enough paren nesting to make it a significant issue, it should probably be broken up anyway.
Side note, I’m quite amused that the sample formatting for style=linux violates linux kernel coding standard (linux uses --add-brackets)