]> eyrie.org Git - kerberos/krb5-strength.git/blobdiff - .clang-format
Tweak RPM spec file
[kerberos/krb5-strength.git] / .clang-format
index 993594ce794e36ddfabd2a77c1f944d7fa902633..b245fddc63a106e0732a1b01e5e762b238f71a7d 100644 (file)
@@ -1,9 +1,11 @@
 # Configuration for clang-format automated reformatting.  -*- yaml -*-
 #
+# This configuration requires Clang 13.0 or later.
+#
 # The canonical version of this file is maintained in the rra-c-util package,
 # which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
 #
-# Copyright 2020 Russ Allbery <eagle@eyrie.org>
+# Copyright 2020-2021 Russ Allbery <eagle@eyrie.org>
 #
 # Copying and distribution of this file, with or without modification, are
 # permitted in any medium without royalty provided the copyright notice
 ---
 Language: Cpp
 BasedOnStyle: LLVM
-AlignConsecutiveMacros: true
+AlignArrayOfStructures: Left
+AlignConsecutiveMacros: AcrossEmptyLinesAndComments
 AlignEscapedNewlines: Left
+AllowShortEnumsOnASingleLine: false
 AlwaysBreakAfterReturnType: AllDefinitions
 BreakBeforeBinaryOperators: NonAssignment
 BreakBeforeBraces: WebKit
@@ -27,3 +31,20 @@ IndentWrappedFunctionNames: false
 MaxEmptyLinesToKeep: 2
 SpaceAfterCStyleCast: true
 ---
+
+# Additional formatting options that we would like to use but cannot (at least
+# yet):
+#
+# PPIndentWidth: 1
+#     Better indentation of #if blocks, but unfortunately in Clang 13.0 this
+#     indentation is also applied to code in #define macros, so produces:
+#
+#     #define ENTRY(args, flags)                     \
+#      do {                                          \
+#       if (args->debug)                             \
+#        putil_log_entry((args), __func__, (flags)); \
+#      } while (0)
+#
+#     Should be used as soon as there is a way to distinguish between
+#     identation of the preprocessor directives themselves and the code blocks
+#     in #define.