是否可以告诉Clang-Format忽略换行操作的注释?我的想法是遵循风格"代码格式正确,即使评论超过换行符#34;代码不应分成多行,如果它不超过保证金,但注释不会。
e.g。
//desired behaviour:
short code = shortCode +
longlonglongCode;
short code = shortCode; //long comment without a line break
//not desired behaviour:
short code =
shortCode; //long comment without a line break
答案 0 :(得分:4)
ReflowComments(
bool
)如果
true
,clang-format
将尝试重新发送评论。false: // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information /* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information */ true: // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of // information /* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of * information */