From 8b35753a2178068b01c66f61a0ced9d590c61653 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 31 Mar 2020 13:35:24 -0600 Subject: [PATCH] Config file for clang-format 8.x and higher based on webkit style. This approximates what I want the sudo coding style to look like. Only deviations from webkit style are included. --- .clang-format | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..cdb6710e1 --- /dev/null +++ b/.clang-format @@ -0,0 +1,41 @@ +--- +Language: Cpp +BasedOnStyle: WebKit +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortFunctionsOnASingleLine: None +AlwaysBreakAfterReturnType: AllDefinitions +BreakBeforeBinaryOperators: None +ColumnLimit: 80 +IndentWidth: 4 +ContinuationIndentWidth: 8 +ForEachMacros: + - HLTQ_FOREACH + - HLTQ_FOREACH_REVERSE + - HLTQ_FOREACH_REVERSE_SAFE + - HLTQ_FOREACH_SAFE + - LIST_FOREACH + - LIST_FOREACH_FROM + - LIST_FOREACH_FROM_SAFE + - LIST_FOREACH_SAFE + - SLIST_FOREACH + - SLIST_FOREACH_FROM + - SLIST_FOREACH_FROM_SAFE + - SLIST_FOREACH_PREVPTR + - SLIST_FOREACH_SAFE + - STAILQ_FOREACH + - STAILQ_FOREACH_FROM + - STAILQ_FOREACH_FROM_SAFE + - STAILQ_FOREACH_SAFE + - TAILQ_FOREACH + - TAILQ_FOREACH_FROM + - TAILQ_FOREACH_FROM_SAFE + - TAILQ_FOREACH_REVERSE + - TAILQ_FOREACH_REVERSE_FROM + - TAILQ_FOREACH_REVERSE_FROM_SAFE + - TAILQ_FOREACH_REVERSE_SAFE + - TAILQ_FOREACH_SAFE +IndentPPDirectives: AfterHash +KeepEmptyLinesAtTheStartOfBlocks: false +PointerAlignment: Right +ReflowComments: false +...