8000 [clang-format] Feature request: do not remove line breaks in function arguments declaration · Issue #167204 · llvm/llvm-project · GitHub
[go: up one dir, main page]

Skip to content

[clang-format] Feature request: do not remove line breaks in function arguments declaration #167204

@mardy

Description

@mardy

This is vaguely related to #50393.

I would like to have an option (I guess it could be a new value in BinPackArguments and BinPackParameters), that would respect the existing line breaks, and only add new line breaks if the column l 607A imit is exceeded. Example:

// unformatted code
set_properties(object,
   "name", name,
       "age", 20);

// desired formatting
set_properties(object,
               "name", name,
               "age", 20);

Same in function declarations:

// unformatted code
void my_function_with_a_long_name_but_please_keep_the_line_breaks(int arg1, int arg2, int arg3,
                                                                             int arg4, int arg5,
                                                                             int arg6, int arg7)
{ ....

// desired formatting
void my_function_with_a_long_name_but_please_keep_the_line_breaks(
    int arg1, int arg2, int arg3,
    int arg4, int arg5,
    int arg6, int arg7)
{ ....

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0