Skip to content

clang-format feature request: Ability to break declaration parameters based on number of parameters #54220

@robertankeney

Description

@robertankeney

I would like to have the option in clang-format to always show one parameter per line for a function declaration. At present, when BinPackParameters is false and the function declaration exceeds the current ColumnLimit, this occurs. For example, for:
void myFunction(int param1, int param2, int param3, int param4, int param5, int param6, int param7)

If ColumnLimit is 80, clang-format will convert it to:

void myFunction(int param1,
                int param2,
                int param3,
                int param4,
                int param5,
                int param6,
                int param7)

Having the option to make this happen when you have more than X parameters (regardless of line length) would be a great step forward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang-formatenhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions