From: Daniel Jasper Date: Sun, 4 Jan 2015 20:40:45 +0000 (+0000) Subject: clang-format: [Java] Change a few flags for Google's Java style. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0046ba3a66c1cb9f79054e9f1a831f86d122f899;p=clang clang-format: [Java] Change a few flags for Google's Java style. No tests added as all of these are already tested separately. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225141 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 81c9e130d5..adcb94f7b9 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -419,7 +419,9 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { if (Language == FormatStyle::LK_Java) { GoogleStyle.AlignAfterOpenBracket = false; GoogleStyle.AlignOperands = false; + GoogleStyle.AlignTrailingComments = false; GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty; + GoogleStyle.AllowShortIfStatementsOnASingleLine = false; GoogleStyle.BreakBeforeBinaryOperators = FormatStyle::BOS_NonAssignment; GoogleStyle.ColumnLimit = 100; GoogleStyle.SpaceAfterCStyleCast = true; @@ -440,6 +442,8 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { FormatStyle getChromiumStyle(FormatStyle::LanguageKind Language) { FormatStyle ChromiumStyle = getGoogleStyle(Language); if (Language == FormatStyle::LK_Java) { + ChromiumStyle.AlignTrailingComments = true; + ChromiumStyle.AllowShortIfStatementsOnASingleLine = true; ChromiumStyle.IndentWidth = 4; ChromiumStyle.ContinuationIndentWidth = 8; } else {