【发布时间】:2015-09-07 22:03:02
【问题描述】:
我想要这个:
if (!enabled)
{
return;
}
转向这个:
if (!enabled) { return; }
(换句话说,我希望在一行中使用简短的 if 语句,但在它们周围保留 {})
目前我正在使用以下配置:
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: true
AllowShortBlocksOnASingleLine: true
BreakBeforeBraces: Allman
但是,我得到的输出是:
if (!enabled)
{
return;
}
上述格式可以用clang-format完成吗?
【问题讨论】:
标签: c++ clang-format