astyle needs to understand the difference between code blocks and initializer lists.
My project config file includes:
--style=1tbs # One True Brace. Linux braces, add braces to all conditionals (-A10)
--style=break # Broken braces (-A1)
--indent=spaces=4 # set indentation to 4 spaces
--indent-switches # indent case from switch
--break-blocks # add blank lines before blocks (e.g., if, while, for)
--keep-one-line-blocks
--keep-one-line-statements
--break-return-type # put the return type of a function on a separate line
--pad-oper # add spaces around operators
--pad-header # add spaces after paren headers (e.g., if, while, for)
--align-pointer=type # int *pInt; --> int* pInt;
--convert-tabs # convert tabs to spaces
--max-code-length=120 # break lines at 120 characters
--break-after-logical # when breaking long lines, leave logical operators on first line
However, this is incompatible with sane handling of initializer lists:
auto const mask_fore = uint8_t{0x01};
auto const mask_aft = uint8_t{0x02};
auto const mask_roof = uint8_t{0x04};
becomes
auto const mask_fore = uint8_t
{
0x01
};
auto const mask_aft = uint8_t
{
0x02
};
auto const mask_roof = uint8_t
{
0x04
};
which is ridiculous.
Did you apply more options? Using this project file the formatting is not being changed.
This was fixed in 3.3-beta1.