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.
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).
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.
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).
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
24 # You can find more information on the different config parameters in this file here:
25 # https://clang.llvm.org/docs/ClangFormatStyleOptions.html
27 AccessModifierOffset: -4
28 AlignAfterOpenBracket: AlwaysBreak
29 AlignEscapedNewlines: Left
31 AllowShortFunctionsOnASingleLine: None
32 AlwaysBreakBeforeMultilineStrings: true
33 AlwaysBreakTemplateDeclarations: Yes
34 BinPackArguments: false
35 BinPackParameters: false
38 SplitEmptyFunction: false
39 SplitEmptyRecord: false
40 SplitEmptyNamespace: false
41 BreakBeforeBraces: Custom
42 BreakBeforeTernaryOperators: false
43 BreakInheritanceList: BeforeComma
44 BreakStringLiterals: false
46 CompactNamespaces: true
47 ConstructorInitializerAllOnOneLineOrOnePerLine: true
48 ConstructorInitializerIndentWidth: 8
49 ContinuationIndentWidth: 16
50 Cpp11BracedListStyle: false
56 - _DNS_ANSWER_FOREACH_FLAGS
57 - DNS_ANSWER_FOREACH_FLAGS
58 - _DNS_ANSWER_FOREACH_FULL
59 - DNS_ANSWER_FOREACH_FULL
60 - _DNS_ANSWER_FOREACH_IFINDEX
61 - DNS_ANSWER_FOREACH_IFINDEX
62 - _DNS_QUESTION_FOREACH
63 - DNS_QUESTION_FOREACH
65 - FOREACH_BTRFS_IOCTL_SEARCH_HEADER
67 - FOREACH_DEVICE_AND_SUBSYSTEM
68 - FOREACH_DEVICE_DEVLINK
69 - FOREACH_DEVICE_PROPERTY
70 - FOREACH_DEVICE_SYSATTR
74 - FOREACH_INOTIFY_EVENT
80 - JOURNAL_FOREACH_DATA_RETVAL
81 - JSON_VARIANT_ARRAY_FOREACH
82 - JSON_VARIANT_OBJECT_FOREACH
88 - MESSAGE_FOREACH_PART
91 - OBJECT_PATH_FOREACH_PREFIX
92 - ORDERED_HASHMAP_FOREACH
93 - ORDERED_HASHMAP_FOREACH_KEY
96 - PATH_FOREACH_PREFIX_MORE
97 - SD_HWDB_FOREACH_PROPERTY
99 - SD_JOURNAL_FOREACH_BACKWARDS
100 - SD_JOURNAL_FOREACH_DATA
101 - SD_JOURNAL_FOREACH_FIELD
102 - SD_JOURNAL_FOREACH_UNIQUE
103 - SECCOMP_FOREACH_LOCAL_ARCH
107 - STRV_FOREACH_BACKWARDS
109 IndentPPDirectives: AfterHash
111 IndentWrappedFunctionNames: true
112 MaxEmptyLinesToKeep: 2
113 PenaltyBreakAssignment: 65
114 PenaltyBreakBeforeFirstCallParameter: 16
115 PenaltyBreakComment: 320
116 PenaltyBreakFirstLessLess: 50
117 PenaltyBreakString: 0
118 PenaltyExcessCharacter: 10
119 PenaltyReturnTypeOnItsOwnLine: 100
120 PointerAlignment: Right
121 SpaceAfterCStyleCast: true
122 SpaceAroundPointerQualifiers: Both
123 SpaceBeforeParens: ControlStatementsExceptForEachMacros