[PATCH] D33589: clang-format: consider not splitting tokens in optimization

Francois Ferrand via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 23 08:49:09 PDT 2017


Typz added a comment.

In https://reviews.llvm.org/D33589#789002, @alexfh wrote:

> why do we want to make an exception for comments and not for regular code?


This is not an exception for comments: the `PenaltyExcessCharacter` is used whenever the code is longer than the `ColumnLimit`, and used to compute the best solution.
The default value is extremely high, so there is no practical difference: code does not go beyond the column, except for specific exceptions.

However, the difference becomes apparent when reducing this penalty: in that case, code can break the column limit instead of wrapping, but it does not happen with comments. This patch tries to restore the parity, and let comments break the comment limit as well.


https://reviews.llvm.org/D33589





More information about the cfe-commits mailing list