зеркало из https://github.com/microsoft/clang-1.git
Formatter: Don't put a space after parameter-naming block comments.
Before: f(a, b, /*doFoo=*/ false); Now: f(a, b, /*doFoo=*/false); This style is a lot more common: $ ack -H '=\*\/\w' lib | wc -l 1281 $ ack -H '=\*\/ \w' lib | wc -l 70 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184894 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
dccd04d861
Коммит
861576b801
|
@ -1110,6 +1110,8 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
|
|||
return false;
|
||||
if (Left.is(tok::period) || Right.is(tok::period))
|
||||
return false;
|
||||
if (Left.Type == TT_BlockComment && Left.TokenText.endswith("=*/"))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -756,7 +756,7 @@ TEST_F(FormatTest, RemovesTrailingWhitespaceOfComments) {
|
|||
}
|
||||
|
||||
TEST_F(FormatTest, UnderstandsBlockComments) {
|
||||
verifyFormat("f(/*test=*/ true);");
|
||||
verifyFormat("f(/*noSpaceAfterParameterNamingComment=*/true);");
|
||||
EXPECT_EQ(
|
||||
"f(aaaaaaaaaaaaaaaaaaaaaaaaa, /* Trailing comment for aa... */\n"
|
||||
" bbbbbbbbbbbbbbbbbbbbbbbbb);",
|
||||
|
|
Загрузка…
Ссылка в новой задаче