-
Notifications
You must be signed in to change notification settings - Fork 15k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang-formatenhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing feature
Description
| Bugzilla Link | 28762 |
| Version | trunk |
| OS | All |
| Reporter | LLVM Bugzilla Contributor |
Extended Description
The style option AllowAllParametersOfDeclarationOnNextLine allows me to
prevent clang-format from pulling all parameters in a function declaration onto
a single line when I have intentionally put them on separate lines. This is
great.
But there doesn't appear to be a corresponding option for function calls.
clang-format is happy to pull function arguments onto a single line, even
when I've intentionally put them on separate lines and disabled bin packing.
Small example that reproduces this:
% cat .clang-format
ColumnLimit: 80
BinPackArguments: false
BinPackParameters: false
AllowAllParametersOfDeclarationOnNextLine: false
AlignAfterOpenBracket: AlwaysBreak
% cat foo.cc
extern int arg_0, arg_1, arg_2;
void DoSomethingWithThreeIntsThatRequiresAVeryLongFunctionNameSeriouslyLong(
int a,
int b,
int c);
void foo() {
// I'm intentionally putting these one per line; I want them to align.
DoSomethingWithThreeIntsThatRequiresAVeryLongFunctionNameSeriouslyLong(
arg_0,
arg_1,
arg_2);
}
% clang-format -style=file foo.cc
extern int arg_0, arg_1, arg_2;
void DoSomethingWithThreeIntsThatRequiresAVeryLongFunctionNameSeriouslyLong(
int a,
int b,
int c);
void foo() {
// I'm intentionally putting these one per line; I want them to align.
DoSomethingWithThreeIntsThatRequiresAVeryLongFunctionNameSeriouslyLong(
arg_0, arg_1, arg_2);
}
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang-formatenhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing feature