clang-format has tons of configuration options regarding whitespace and also some about code order (order of includes). Is it possible to reorder const-qualifiers so that they are placed to the right of the respective type?
Example: The declaration const int x = 0; should be formatted to int const x = 0;.
From version 14.0 onwards, clang-format offers the option
QualifierAlignmentwhich can take the following values:Leave,Left,RightandCustom.OP's request can thus be achieved with
Documentation can be found here
Edit: More information on values of
QualifierAlignmentWhen
Customis used as the value forQualifierAlignment, the order from the clang-format optionQualifierOrderis used. These two options have to then be used together, like so:Edit2: It seems the prefix 'QAS' of QAS_Right, QAS_Left etc is not needed.