From 5ee32fbefcccb580d93d7cfe60b552e01f9f5bc4 Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Tue, 8 Jan 2019 12:47:53 -0800 Subject: [PATCH] Add `.clang-format` Summary: @public Add `.clang-format` for automatic formatting of our C++ code. Reviewed By: SidharthGuglani Differential Revision: D13596651 fbshipit-source-id: c3f866ad552cd7a1d5824f43b093f45842a2142e --- .clang-format | 56 ++++++++++++++++++++++++++++++++++++++++++++ .clang-format-ignore | 1 + 2 files changed, 57 insertions(+) create mode 100644 .clang-format create mode 100644 .clang-format-ignore diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..52a48cf2 --- /dev/null +++ b/.clang-format @@ -0,0 +1,56 @@ +Language: Cpp +AccessModifierOffset: -2 +AlignAfterOpenBracket: AlwaysBreak +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Left +AlignOperands: false +AlignTrailingComments: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: true +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: false +BinPackParameters: false +BreakBeforeBinaryOperators: false +BreakBeforeBraces: Attach +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeColon +BreakInheritanceList: BeforeColon +BreakStringLiterals: true +ColumnLimit: 80 +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: false +FixNamespaceComments: true +IndentCaseLabels: true +IndentPPDirectives: None +IndentWidth: 2 +IndentWrappedFunctionNames: false +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +PenaltyReturnTypeOnItsOwnLine: 2000 +PointerAlignment: Left +ReflowComments: true +SortIncludes: false +SortUsingDeclarations: true +SpaceAfterCStyleCast: true +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +Standard: Cpp11 +UseTab: Never diff --git a/.clang-format-ignore b/.clang-format-ignore new file mode 100644 index 00000000..51430a06 --- /dev/null +++ b/.clang-format-ignore @@ -0,0 +1 @@ +^lib/.*