[PATCH] D53072: [clang-format] Introduce the flag which allows not to shrink lines

2019-01-11 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. Ok, but this behavior is still intended. You are setting clang-format to a format where it is breaking after binary operators and then added a break before a binary operator. clang-format assumes that this is not intended and that you will want this cleaned up. E.g.:

[PATCH] D53072: [clang-format] Introduce the flag which allows not to shrink lines

2019-01-11 Thread Ivan Donchevskii via Phabricator via cfe-commits
yvvan updated this revision to Diff 181274. yvvan added a comment. The tests are improved - now they actually act differently with and without the introduced flag. Also few more cases are covered (see the second added test). CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53072/new/

[PATCH] D53072: [clang-format] Introduce the flag which allows not to shrink lines

2019-01-07 Thread Ivan Donchevskii via Phabricator via cfe-commits
yvvan added a comment. @djasper Ok, if there's a possible way to go forward I will find time to provide a better test which behaves differently depending on this check. Also my current patch is a bit bigger than this version. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53072/new/

[PATCH] D53072: [clang-format] Introduce the flag which allows not to shrink lines

2019-01-07 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. Without understanding this in more detail I do not know how to move forward with this. What this patch is describing is what should already be the case with ColumnLimit set to zero. If it isn't this might be a bug or there might be a different way to move forward.

[PATCH] D53072: [clang-format] Introduce the flag which allows not to shrink lines

2019-01-07 Thread Ivan Donchevskii via Phabricator via cfe-commits
yvvan added a comment. In D53072#1348033 , @djasper wrote: > $ cat /tmp/test.cc > int foo(int a, > int b) { > f(); > } > > $ clang-format -style="{ColumnLimit: 0}" /tmp/test.cc > int foo(int a, > int b) { >

[PATCH] D53072: [clang-format] Introduce the flag which allows not to shrink lines

2019-01-07 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. $ cat /tmp/test.cc int foo(int a, int b) { f(); } $ clang-format -style="{ColumnLimit: 0}" /tmp/test.cc int foo(int a, int b) { f(); } Is this not what you want? If so, in what way? CHANGES SINCE LAST ACTION

[PATCH] D53072: [clang-format] Introduce the flag which allows not to shrink lines

2019-01-07 Thread Ivan Donchevskii via Phabricator via cfe-commits
yvvan added a comment. In D53072#1342363 , @djasper wrote: > I don't quite understand. What you are describing should already be the > behavior with ColumnLimit=0 and I think your test should pass without the new > option. Doesn't it? As far as I see

[PATCH] D53072: [clang-format] Introduce the flag which allows not to shrink lines

2018-12-29 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. I don't quite understand. What you are describing should already be the behavior with ColumnLimit=0 and I think your test should pass without the new option. Doesn't it? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53072/new/ https://reviews.llvm.org/D53072

[PATCH] D53072: [clang-format] Introduce the flag which allows not to shrink lines

2018-12-29 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. In D53072#1268883 , @yvvan wrote: > Do you know the better way to accomplish my aim than adding an option to > libFormat? For example making a dependent library which serves a little > different purpose than libFormat itself or

[PATCH] D53072: [clang-format] Introduce the flag which allows not to shrink lines

2018-10-19 Thread Ivan Donchevskii via Phabricator via cfe-commits
yvvan added a comment. Do you know the better way to accomplish my aim than adding an option to libFormat? For example making a dependent library which serves a little different purpose than libFormat itself or something simpler? https://reviews.llvm.org/D53072

[PATCH] D53072: [clang-format] Introduce the flag which allows not to shrink lines

2018-10-18 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir requested changes to this revision. krasimir added a comment. This revision now requires changes to proceed. In general there's a high bar for adding new style options to clang-format: https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options

[PATCH] D53072: [clang-format] Introduce the flag which allows not to shrink lines

2018-10-10 Thread Ivan Donchevskii via Phabricator via cfe-commits
yvvan created this revision. yvvan added reviewers: klimek, djasper, krasimir. Currently there's no way to prevent to lines optimization even if you have intentionally put to split the line. In general case it's fine. So I would prefer to have such option which you can enable in special cases