From 56013367983b61d8ee4d2e905767ce50b25ffb82 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Mon, 30 Oct 2017 09:39:16 +0100 Subject: [PATCH 1/3] Turn the style guide into a clang-format file --- .clang-format | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..5501478f --- /dev/null +++ b/.clang-format @@ -0,0 +1,37 @@ +# IndentPPDirectives: None +# SpaceInParentheses: false +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: true +BinPackArguments: true +BinPackParameters: true +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Attach +BreakBeforeTernaryOperators: true +ColumnLimit: 100 +IndentCaseLabels: true +IndentWidth: 8 +IndentWrappedFunctionNames: true +KeepEmptyLinesAtTheStartOfBlocks: false +Language: Cpp +MaxEmptyLinesToKeep: 1 +PointerAlignment: Right +SortIncludes: true +SpaceAfterCStyleCast: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesInCStyleCastParentheses: false +SpacesInSquareBrackets: false +TabWidth: 8 +UseTab: ForIndentation From 596fa6b51ed2ab6be80041684ad805f7b22256ac Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sat, 11 Nov 2017 09:14:41 +0100 Subject: [PATCH 2/3] Take into account Nei's suggestions --- .clang-format | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.clang-format b/.clang-format index 5501478f..295356df 100644 --- a/.clang-format +++ b/.clang-format @@ -1,4 +1,4 @@ -# IndentPPDirectives: None +# IndentPPDirectives: AfterHash # SpaceInParentheses: false AlignAfterOpenBracket: Align AlignConsecutiveAssignments: false @@ -12,22 +12,23 @@ AllowShortFunctionsOnASingleLine: Empty AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AlwaysBreakAfterReturnType: None -AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakBeforeMultilineStrings: false BinPackArguments: true BinPackParameters: true BreakBeforeBinaryOperators: None -BreakBeforeBraces: Attach -BreakBeforeTernaryOperators: true +BreakBeforeBraces: Linux +BreakBeforeTernaryOperators: false ColumnLimit: 100 IndentCaseLabels: true IndentWidth: 8 IndentWrappedFunctionNames: true KeepEmptyLinesAtTheStartOfBlocks: false Language: Cpp +Cpp11BracedListStyle: false MaxEmptyLinesToKeep: 1 PointerAlignment: Right SortIncludes: true -SpaceAfterCStyleCast: false +SpaceAfterCStyleCast: true SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false From ba3c5801a4bb175fe1e0d0fd273ae15318dd2b03 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Thu, 16 Nov 2017 13:50:48 +0100 Subject: [PATCH 3/3] Update .clang-format do not indent case deeper --- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index 295356df..1180910e 100644 --- a/.clang-format +++ b/.clang-format @@ -19,7 +19,7 @@ BreakBeforeBinaryOperators: None BreakBeforeBraces: Linux BreakBeforeTernaryOperators: false ColumnLimit: 100 -IndentCaseLabels: true +IndentCaseLabels: false IndentWidth: 8 IndentWrappedFunctionNames: true KeepEmptyLinesAtTheStartOfBlocks: false