]> git.ipfire.org Git - thirdparty/systemd.git/blame - .clang-format
po: Translated using Weblate (Slovenian)
[thirdparty/systemd.git] / .clang-format
CommitLineData
f3a604e4
SJ
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
b36c5e95 4# change should be reviewed and only the appropriate ones committed.
f3a604e4 5#
84cb2708
NL
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).
f3a604e4 8#
5b72b347 9# - Fix up formatting before committing
84cb2708
NL
10# 1. Edit and stage your files.
11# 2. Run `git clang-format`.
12# 3. Verify + correct + (un)stage changes.
13# 4. Commit.
14#
5b72b347 15# - Fix up formatting after committing
84cb2708
NL
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:
f3a604e4 22# $ git ls-files 'src/*.[ch]' 'src/*.cc' | xargs clang-format -i -style=file
84cb2708 23#
f3a604e4
SJ
24# You can find more information on the different config parameters in this file here:
25# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
26---
27AccessModifierOffset: -4
28AlignAfterOpenBracket: AlwaysBreak
c7423172 29AlignArrayOfStructures: Right
f3a604e4 30AlignEscapedNewlines: Left
2581dbcb 31AlignOperands: false
f3a604e4
SJ
32AllowShortFunctionsOnASingleLine: None
33AlwaysBreakBeforeMultilineStrings: true
34AlwaysBreakTemplateDeclarations: Yes
35BinPackArguments: false
36BinPackParameters: false
37BraceWrapping:
2581dbcb 38 AfterEnum: false
f3a604e4
SJ
39 SplitEmptyFunction: false
40 SplitEmptyRecord: false
41 SplitEmptyNamespace: false
42BreakBeforeBraces: Custom
f3a604e4 43BreakBeforeTernaryOperators: false
2581dbcb 44BreakInheritanceList: BeforeComma
f3a604e4 45BreakStringLiterals: false
2581dbcb 46ColumnLimit: 109
f3a604e4
SJ
47CompactNamespaces: true
48ConstructorInitializerAllOnOneLineOrOnePerLine: true
49ConstructorInitializerIndentWidth: 8
92148fb7 50ContinuationIndentWidth: 16
f3a604e4
SJ
51Cpp11BracedListStyle: false
52ForEachMacros:
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
f3a604e4
SJ
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
110IndentPPDirectives: AfterHash
2581dbcb 111IndentWidth: 8
f3a604e4
SJ
112IndentWrappedFunctionNames: true
113MaxEmptyLinesToKeep: 2
114PenaltyBreakAssignment: 65
115PenaltyBreakBeforeFirstCallParameter: 16
116PenaltyBreakComment: 320
117PenaltyBreakFirstLessLess: 50
118PenaltyBreakString: 0
119PenaltyExcessCharacter: 10
120PenaltyReturnTypeOnItsOwnLine: 100
2581dbcb 121PointerAlignment: Right
f3a604e4 122SpaceAfterCStyleCast: true
2581dbcb 123SpaceAroundPointerQualifiers: Both
36046ce7 124SpaceBeforeParens: ControlStatementsExceptForEachMacros
2581dbcb
JJ
125SpacesInAngles: true
126TabWidth: 8
127UseCRLF: false