]> git.ipfire.org Git - thirdparty/systemd.git/blob - .clang-format
test: make coverage runs happy with capsule@.service
[thirdparty/systemd.git] / .clang-format
1 # This configuration file can be used to auto-format the code base.
2 # Not all guidelines specified in CODING_STYLE are followed, so the
3 # result MUST NOT be committed indiscriminately, but each automated
4 # change should be reviewed and only the appropriate ones committed.
5 #
6 # The easiest way to apply the formatting to your changes ONLY,
7 # is to use the git-clang-format script (usually installed with clang-format).
8 #
9 # - Fix up formatting before committing
10 # 1. Edit and stage your files.
11 # 2. Run `git clang-format`.
12 # 3. Verify + correct + (un)stage changes.
13 # 4. Commit.
14 #
15 # - Fix up formatting after committing
16 # 1. Commit your changes.
17 # 2. Run `git clang-format HEAD~` - Refer the commit *before* your changes here.
18 # 3. Verify + correct changes, `git difftool -d` can help here.
19 # 4. Stage + commit, potentially with `--amend` (means to fixup the last commit).
20 #
21 # To run clang-format on all sourcefiles, use the following line:
22 # $ git ls-files 'src/*.[ch]' 'src/*.cc' | xargs clang-format -i -style=file
23 #
24 # You can find more information on the different config parameters in this file here:
25 # https://clang.llvm.org/docs/ClangFormatStyleOptions.html
26 ---
27 AccessModifierOffset: -4
28 AlignAfterOpenBracket: AlwaysBreak
29 AlignArrayOfStructures: Right
30 AlignEscapedNewlines: Left
31 AlignOperands: false
32 AllowShortFunctionsOnASingleLine: None
33 AlwaysBreakBeforeMultilineStrings: true
34 AlwaysBreakTemplateDeclarations: Yes
35 BinPackArguments: false
36 BinPackParameters: false
37 BraceWrapping:
38 AfterEnum: false
39 SplitEmptyFunction: false
40 SplitEmptyRecord: false
41 SplitEmptyNamespace: false
42 BreakBeforeBraces: Custom
43 BreakBeforeTernaryOperators: false
44 BreakInheritanceList: BeforeComma
45 BreakStringLiterals: false
46 ColumnLimit: 109
47 CompactNamespaces: true
48 ConstructorInitializerAllOnOneLineOrOnePerLine: true
49 ConstructorInitializerIndentWidth: 8
50 ContinuationIndentWidth: 16
51 Cpp11BracedListStyle: false
52 ForEachMacros:
53 - BITMAP_FOREACH
54 - CMSG_FOREACH
55 - _DNS_ANSWER_FOREACH
56 - DNS_ANSWER_FOREACH
57 - _DNS_ANSWER_FOREACH_FLAGS
58 - DNS_ANSWER_FOREACH_FLAGS
59 - _DNS_ANSWER_FOREACH_FULL
60 - DNS_ANSWER_FOREACH_FULL
61 - _DNS_ANSWER_FOREACH_IFINDEX
62 - DNS_ANSWER_FOREACH_IFINDEX
63 - _DNS_QUESTION_FOREACH
64 - DNS_QUESTION_FOREACH
65 - FDSET_FOREACH
66 - FOREACH_BTRFS_IOCTL_SEARCH_HEADER
67 - FOREACH_DEVICE
68 - FOREACH_DEVICE_AND_SUBSYSTEM
69 - FOREACH_DEVICE_DEVLINK
70 - FOREACH_DEVICE_PROPERTY
71 - FOREACH_DEVICE_SYSATTR
72 - FOREACH_DEVICE_TAG
73 - FOREACH_DIRENT
74 - FOREACH_DIRENT_ALL
75 - FOREACH_INOTIFY_EVENT
76 - FOREACH_STRING
77 - FOREACH_SUBSYSTEM
78 - HASHMAP_FOREACH
79 - HASHMAP_FOREACH_IDX
80 - HASHMAP_FOREACH_KEY
81 - JOURNAL_FOREACH_DATA_RETVAL
82 - JSON_VARIANT_ARRAY_FOREACH
83 - JSON_VARIANT_OBJECT_FOREACH
84 - LIST_FOREACH
85 - LIST_FOREACH_AFTER
86 - LIST_FOREACH_BEFORE
87 - LIST_FOREACH_OTHERS
88 - LIST_FOREACH_SAFE
89 - MESSAGE_FOREACH_PART
90 - NULSTR_FOREACH
91 - NULSTR_FOREACH_PAIR
92 - OBJECT_PATH_FOREACH_PREFIX
93 - ORDERED_HASHMAP_FOREACH
94 - ORDERED_HASHMAP_FOREACH_KEY
95 - ORDERED_SET_FOREACH
96 - PATH_FOREACH_PREFIX
97 - PATH_FOREACH_PREFIX_MORE
98 - SD_HWDB_FOREACH_PROPERTY
99 - SD_JOURNAL_FOREACH
100 - SD_JOURNAL_FOREACH_BACKWARDS
101 - SD_JOURNAL_FOREACH_DATA
102 - SD_JOURNAL_FOREACH_FIELD
103 - SD_JOURNAL_FOREACH_UNIQUE
104 - SECCOMP_FOREACH_LOCAL_ARCH
105 - SET_FOREACH
106 - SET_FOREACH_MOVE
107 - STRV_FOREACH
108 - STRV_FOREACH_BACKWARDS
109 - STRV_FOREACH_PAIR
110 IndentPPDirectives: AfterHash
111 IndentWidth: 8
112 IndentWrappedFunctionNames: true
113 MaxEmptyLinesToKeep: 2
114 PenaltyBreakAssignment: 65
115 PenaltyBreakBeforeFirstCallParameter: 16
116 PenaltyBreakComment: 320
117 PenaltyBreakFirstLessLess: 50
118 PenaltyBreakString: 0
119 PenaltyExcessCharacter: 10
120 PenaltyReturnTypeOnItsOwnLine: 100
121 PointerAlignment: Right
122 SpaceAfterCStyleCast: true
123 SpaceAroundPointerQualifiers: Both
124 SpaceBeforeParens: ControlStatementsExceptForEachMacros
125 SpacesInAngles: true
126 TabWidth: 8
127 UseCRLF: false