From: Daniel Jasper Date: Wed, 24 Apr 2013 13:46:00 +0000 (+0000) Subject: Flip flag to merge short if-statements into one line for Google style. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=94d6ad7b65b59f834bbc40e0caed5ceebca11932;p=clang Flip flag to merge short if-statements into one line for Google style. This now allows clang-format to do: if (a) return; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180187 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 0c3f85d124..b483308a5a 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -67,7 +67,7 @@ FormatStyle getGoogleStyle() { GoogleStyle.BinPackParameters = true; GoogleStyle.AllowAllParametersOfDeclarationOnNextLine = true; GoogleStyle.ConstructorInitializerAllOnOneLineOrOnePerLine = true; - GoogleStyle.AllowShortIfStatementsOnASingleLine = false; + GoogleStyle.AllowShortIfStatementsOnASingleLine = true; GoogleStyle.ObjCSpaceBeforeProtocolList = false; GoogleStyle.PenaltyExcessCharacter = 1000000; GoogleStyle.PenaltyReturnTypeOnItsOwnLine = 200; @@ -77,6 +77,7 @@ FormatStyle getGoogleStyle() { FormatStyle getChromiumStyle() { FormatStyle ChromiumStyle = getGoogleStyle(); ChromiumStyle.AllowAllParametersOfDeclarationOnNextLine = false; + ChromiumStyle.AllowShortIfStatementsOnASingleLine = false; ChromiumStyle.BinPackParameters = false; ChromiumStyle.Standard = FormatStyle::LS_Cpp03; ChromiumStyle.DerivePointerBinding = false;