clang-format: Change Google style wrt. the formatting of empty messages.

Before:
  message Empty {
  }

After:
  message Empty {}

llvm-svn: 339803
This commit is contained in:
Daniel Jasper 2018-08-15 19:07:55 +00:00
parent 00fb14da27
commit 67e6521a67
2 changed files with 5 additions and 9 deletions

View File

@ -819,7 +819,7 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) {
GoogleStyle.JavaScriptQuotes = FormatStyle::JSQS_Single;
GoogleStyle.JavaScriptWrapImports = false;
} else if (Language == FormatStyle::LK_Proto) {
GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None;
GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty;
GoogleStyle.AlwaysBreakBeforeMultilineStrings = false;
GoogleStyle.SpacesInContainerLiterals = false;
GoogleStyle.Cpp11BracedListStyle = false;

View File

@ -397,29 +397,25 @@ TEST_F(FormatTestProto, FormatsService) {
}
TEST_F(FormatTestProto, ExtendingMessage) {
verifyFormat("extend .foo.Bar {\n"
"}");
verifyFormat("extend .foo.Bar {}");
}
TEST_F(FormatTestProto, FormatsImports) {
verifyFormat("import \"a.proto\";\n"
"import \"b.proto\";\n"
"// comment\n"
"message A {\n"
"}");
"message A {}");
verifyFormat("import public \"a.proto\";\n"
"import \"b.proto\";\n"
"// comment\n"
"message A {\n"
"}");
"message A {}");
// Missing semicolons should not confuse clang-format.
verifyFormat("import \"a.proto\"\n"
"import \"b.proto\"\n"
"// comment\n"
"message A {\n"
"}");
"message A {}");
}
TEST_F(FormatTestProto, KeepsLongStringLiteralsOnSameLine) {