Hi,
I would like to configure clang-format (version 3.6.0) not to break long
string literals despite the ColumnLimit. I tried setting PenaltyBreakString
to a large value and PenaltyExcessCharacter to a small value. This doesn't
seem to have any effect.
This is an example program:
#include <string>
int main() {
std::string s = "this is a really long string that"
"i really would like to have formatted differently, in
particular I want this line to stay like this";
}
clang-format --dump-config reports
ColumnLimit: 80
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakString: 2000000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1
PenaltyReturnTypeOnItsOwnLine: 60
yet the program is formatted as such:
#include <string>
int main() {
std::string s = "this is a really long string that"
"i really would like to have formatted differently, in "
"particular I want this line to stay like this";
}
I there a way to solve this problem, or is this something clang can't do?
Greets,
Adrian