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 commited.
6 # To apply the coding style you can run the following command (assuming you
7 # installed clang-format on your system):
9 # $ git ls-files 'src/*.[ch]' 'src/*.cc' | xargs clang-format -i -style=file
10 # You can find more information on the different config parameters in this file here:
11 # https://clang.llvm.org/docs/ClangFormatStyleOptions.html
13 AccessModifierOffset: -4
14 AlignAfterOpenBracket: AlwaysBreak
15 AlignEscapedNewlines: Left
17 AllowShortFunctionsOnASingleLine: None
18 AlwaysBreakBeforeMultilineStrings: true
19 AlwaysBreakTemplateDeclarations: Yes
20 BinPackArguments: false
21 BinPackParameters: false
24 SplitEmptyFunction: false
25 SplitEmptyRecord: false
26 SplitEmptyNamespace: false
27 BreakBeforeBraces: Custom
28 BreakInheritanceList: BeforeComma
29 BreakBeforeTernaryOperators: false
30 BreakStringLiterals: false
32 CompactNamespaces: true
33 ConstructorInitializerAllOnOneLineOrOnePerLine: true
34 ConstructorInitializerIndentWidth: 8
35 ContinuationIndentWidth: 8
36 Cpp11BracedListStyle: false
42 - _DNS_ANSWER_FOREACH_FLAGS
43 - DNS_ANSWER_FOREACH_FLAGS
44 - _DNS_ANSWER_FOREACH_FULL
45 - DNS_ANSWER_FOREACH_FULL
46 - _DNS_ANSWER_FOREACH_IFINDEX
47 - DNS_ANSWER_FOREACH_IFINDEX
48 - _DNS_QUESTION_FOREACH
49 - DNS_QUESTION_FOREACH
51 - FOREACH_BTRFS_IOCTL_SEARCH_HEADER
53 - FOREACH_DEVICE_AND_SUBSYSTEM
54 - FOREACH_DEVICE_DEVLINK
55 - FOREACH_DEVICE_PROPERTY
56 - FOREACH_DEVICE_SYSATTR
60 - FOREACH_INOTIFY_EVENT
65 - FOREACH_WORD_SEPARATOR
69 - JOURNAL_FOREACH_DATA_RETVAL
70 - JSON_VARIANT_ARRAY_FOREACH
71 - JSON_VARIANT_OBJECT_FOREACH
77 - MESSAGE_FOREACH_PART
80 - OBJECT_PATH_FOREACH_PREFIX
81 - ORDERED_HASHMAP_FOREACH
82 - ORDERED_HASHMAP_FOREACH_KEY
85 - PATH_FOREACH_PREFIX_MORE
86 - SD_HWDB_FOREACH_PROPERTY
88 - SD_JOURNAL_FOREACH_BACKWARDS
89 - SD_JOURNAL_FOREACH_DATA
90 - SD_JOURNAL_FOREACH_FIELD
91 - SD_JOURNAL_FOREACH_UNIQUE
92 - SECCOMP_FOREACH_LOCAL_ARCH
96 - STRV_FOREACH_BACKWARDS
98 IndentPPDirectives: AfterHash
100 IndentWrappedFunctionNames: true
101 MaxEmptyLinesToKeep: 2
102 PenaltyBreakAssignment: 65
103 PenaltyBreakBeforeFirstCallParameter: 16
104 PenaltyBreakComment: 320
105 PenaltyBreakFirstLessLess: 50
106 PenaltyBreakString: 0
107 PenaltyExcessCharacter: 10
108 PenaltyReturnTypeOnItsOwnLine: 100
109 SpaceAfterCStyleCast: true