]> eyrie.org Git - kerberos/krb5-strength.git/blob - .clang-format
Add dependabot configuration
[kerberos/krb5-strength.git] / .clang-format
1 # Configuration for clang-format automated reformatting.  -*- yaml -*-
2 #
3 # This configuration requires Clang 13.0 or later.
4 #
5 # The canonical version of this file is maintained in the rra-c-util package,
6 # which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
7 #
8 # Copyright 2020-2021 Russ Allbery <eagle@eyrie.org>
9 #
10 # Copying and distribution of this file, with or without modification, are
11 # permitted in any medium without royalty provided the copyright notice
12 # and this notice are preserved.  This file is offered as-is, without any
13 # warranty.
14 #
15 # SPDX-License-Identifier: FSFAP
16
17 ---
18 Language: Cpp
19 BasedOnStyle: LLVM
20 AlignArrayOfStructures: Left
21 AlignConsecutiveMacros: AcrossEmptyLinesAndComments
22 AlignEscapedNewlines: Left
23 AllowShortEnumsOnASingleLine: false
24 AlwaysBreakAfterReturnType: AllDefinitions
25 BreakBeforeBinaryOperators: NonAssignment
26 BreakBeforeBraces: WebKit
27 ColumnLimit: 79
28 IndentPPDirectives: AfterHash
29 IndentWidth: 4
30 IndentWrappedFunctionNames: false
31 MaxEmptyLinesToKeep: 2
32 SpaceAfterCStyleCast: true
33 ---
34
35 # Additional formatting options that we would like to use but cannot (at least
36 # yet):
37 #
38 # PPIndentWidth: 1
39 #     Better indentation of #if blocks, but unfortunately in Clang 13.0 this
40 #     indentation is also applied to code in #define macros, so produces:
41 #
42 #     #define ENTRY(args, flags)                     \
43 #      do {                                          \
44 #       if (args->debug)                             \
45 #        putil_log_entry((args), __func__, (flags)); \
46 #      } while (0)
47 #
48 #     Should be used as soon as there is a way to distinguish between
49 #     identation of the preprocessor directives themselves and the code blocks
50 #     in #define.