diff options
Diffstat (limited to '_clang-format')
-rw-r--r-- | _clang-format | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/_clang-format b/_clang-format index 19d2e364..2fa7c0b0 100644 --- a/_clang-format +++ b/_clang-format @@ -28,8 +28,8 @@ CommentPragmas: "^!|^:|^ SPDX-License-Identifier:" # We want a space between the type and the star for pointer types. PointerBindsToType: false -# We use template< without space. -SpaceAfterTemplateKeyword: false +# We generally use "template <" with space. +SpaceAfterTemplateKeyword: true # We want to break before the operators, but not before a '='. BreakBeforeBinaryOperators: NonAssignment @@ -62,6 +62,8 @@ NamespaceIndentation: None # Allow indentation for preprocessing directives (if/ifdef/endif). https://reviews.llvm.org/rL312125 IndentPPDirectives: AfterHash +# We only indent with 2 spaces for preprocessor directives +PPIndentWidth: 2 # Horizontally align arguments after an open bracket. # The coding style does not specify the following, but this is what gives @@ -85,7 +87,28 @@ ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCH # Break constructor initializers before the colon and after the commas. BreakConstructorInitializers: BeforeColon +# Add "// namespace <namespace>" comments on closing brace for a namespace +# Ignored for namespaces that qualify as a short namespace, +# see 'ShortNamespaceLines' +FixNamespaceComments: true + +# Definition of how short a short namespace is, default 1 +ShortNamespaceLines: 1 + +# When escaping newlines in a macro attach the '\' as far left as possible, e.g. +##define a \ +# something; \ +# other; \ +# thelastlineislong; +AlignEscapedNewlines: Left + # Avoids the addition of a space between an identifier and the # initializer list in list-initialization. SpaceBeforeCpp11BracedList: false +--- +# Use the Google-based style for .proto files. +Language: Proto +BasedOnStyle: Google +IndentWidth: 4 +ColumnLimit: 100 |