X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=.clang-format;h=b925f8c2f0339cbcabca878a968d7d8294c7c7c5;hb=976a0ed6ac7e57709c5917bfe7d9c8141e80e901;hp=977ed2dbf00382efdf36a52330147e56ae465096;hpb=dc15be2ca7c51772b00e4c5548934a35aa7e4add;p=vpp.git diff --git a/.clang-format b/.clang-format index 977ed2dbf00..b925f8c2f03 100644 --- a/.clang-format +++ b/.clang-format @@ -1,38 +1,28 @@ ---- -AlignEscapedNewlinesLeft: true -AlignTrailingComments: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortIfStatementsOnASingleLine: false -AllowShortLoopsOnASingleLine: false -AllowShortFunctionsOnASingleLine: false -AlwaysBreakBeforeMultilineStrings: false -BreakBeforeBinaryOperators: false -BreakBeforeTernaryOperators: true -BinPackParameters: true -BreakBeforeBraces: GNU -ColumnLimit: 79 -IndentCaseLabels: false -MaxEmptyLinesToKeep: 1 -PenaltyBreakBeforeFirstCallParameter: 19 -PenaltyBreakComment: 60 -PenaltyBreakString: 1000 -PenaltyBreakFirstLessLess: 120 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 60 -PointerBindsToType: false -SpaceBeforeAssignmentOperators: true -SpaceBeforeParens: Always -SpacesBeforeTrailingComments: 1 -SpacesInParentheses: false -SpaceInEmptyParentheses: false -SpacesInCStyleCastParentheses: false -SpaceAfterControlStatementKeyword: true -Cpp11BracedListStyle: true -Standard: Cpp11 +# Minimal clang-format version is 8 + +BasedOnStyle: GNU +UseTab: Always +SpaceAfterCStyleCast: true SortIncludes: false -IndentWidth: 2 -TabWidth: 4 -UseTab: Never -IndentFunctionDeclarationAfterType: false -ContinuationIndentWidth: 4 -... +AlignConsecutiveMacros: true +BreakBeforeTernaryOperators: false +BreakBeforeBinaryOperators: None +ContinuationIndentWidth: 2 + +ForEachMacros: + - 'clib_bitmap_foreach' + - 'pool_foreach' + - 'pool_foreach_index' + - 'vec_foreach' + - 'vec_foreach_backwards' + - 'vec_foreach_index' + - 'vec_foreach_index_backwards' + - 'vlib_foreach_rx_tx' + - 'foreach_vlib_main' + +StatementMacros: + - 'CLIB_MULTIARCH_FN' + - 'VLIB_NODE_FN' + - 'VNET_DEVICE_CLASS_TX_FN' + - '__clib_section' + - '__clib_aligned'