1# SPDX-License-Identifier: Apache-2.0
2#
3# Note: The list of ForEachMacros can be obtained using:
4#
5#    git grep -h '^#define [^[:space:]]*FOR_EACH[^[:space:]]*(' include/ \
6#    | sed "s,^#define \([^[:space:]]*FOR_EACH[^[:space:]]*\)(.*$,  - '\1'," \
7#    | sort | uniq
8#
9# References:
10#   - https://clang.llvm.org/docs/ClangFormatStyleOptions.html
11
12---
13BasedOnStyle: LLVM
14AlignConsecutiveMacros: AcrossComments
15AllowShortBlocksOnASingleLine: Never
16AllowShortCaseLabelsOnASingleLine: false
17AllowShortEnumsOnASingleLine: false
18AllowShortFunctionsOnASingleLine: None
19AllowShortIfStatementsOnASingleLine: false
20AllowShortLoopsOnASingleLine: false
21AttributeMacros:
22  - __aligned
23  - __deprecated
24  - __packed
25  - __printf_like
26  - __syscall
27  - __syscall_always_inline
28  - __subsystem
29BitFieldColonSpacing: After
30BreakBeforeBraces: Linux
31ColumnLimit: 100
32ConstructorInitializerIndentWidth: 8
33ContinuationIndentWidth: 8
34ForEachMacros:
35  - 'FOR_EACH'
36  - 'FOR_EACH_FIXED_ARG'
37  - 'FOR_EACH_IDX'
38  - 'FOR_EACH_IDX_FIXED_ARG'
39  - 'FOR_EACH_NONEMPTY_TERM'
40  - 'RB_FOR_EACH'
41  - 'RB_FOR_EACH_CONTAINER'
42  - 'SYS_DLIST_FOR_EACH_CONTAINER'
43  - 'SYS_DLIST_FOR_EACH_CONTAINER_SAFE'
44  - 'SYS_DLIST_FOR_EACH_NODE'
45  - 'SYS_DLIST_FOR_EACH_NODE_SAFE'
46  - 'SYS_SFLIST_FOR_EACH_CONTAINER'
47  - 'SYS_SFLIST_FOR_EACH_CONTAINER_SAFE'
48  - 'SYS_SFLIST_FOR_EACH_NODE'
49  - 'SYS_SFLIST_FOR_EACH_NODE_SAFE'
50  - 'SYS_SLIST_FOR_EACH_CONTAINER'
51  - 'SYS_SLIST_FOR_EACH_CONTAINER_SAFE'
52  - 'SYS_SLIST_FOR_EACH_NODE'
53  - 'SYS_SLIST_FOR_EACH_NODE_SAFE'
54  - '_WAIT_Q_FOR_EACH'
55  - 'Z_FOR_EACH'
56  - 'Z_FOR_EACH_ENGINE'
57  - 'Z_FOR_EACH_EXEC'
58  - 'Z_FOR_EACH_FIXED_ARG'
59  - 'Z_FOR_EACH_FIXED_ARG_EXEC'
60  - 'Z_FOR_EACH_IDX'
61  - 'Z_FOR_EACH_IDX_EXEC'
62  - 'Z_FOR_EACH_IDX_FIXED_ARG'
63  - 'Z_FOR_EACH_IDX_FIXED_ARG_EXEC'
64  - 'Z_GENLIST_FOR_EACH_CONTAINER'
65  - 'Z_GENLIST_FOR_EACH_CONTAINER_SAFE'
66  - 'Z_GENLIST_FOR_EACH_NODE'
67  - 'Z_GENLIST_FOR_EACH_NODE_SAFE'
68  - 'STRUCT_SECTION_FOREACH'
69  - 'TYPE_SECTION_FOREACH'
70IfMacros:
71  - 'CHECKIF'
72# Disabled for now, see bug https://github.com/zephyrproject-rtos/zephyr/issues/48520
73#IncludeBlocks: Regroup
74IncludeCategories:
75  - Regex: '^".*\.h"$'
76    Priority: 0
77  - Regex: '^<(assert|complex|ctype|errno|fenv|float|inttypes|limits|locale|math|setjmp|signal|stdarg|stdbool|stddef|stdint|stdio|stdlib|string|tgmath|time|wchar|wctype)\.h>$'
78    Priority: 1
79  - Regex: '^\<zephyr/.*\.h\>$'
80    Priority: 2
81  - Regex: '.*'
82    Priority: 3
83IndentCaseLabels: false
84IndentWidth: 8
85InsertBraces: true
86SpaceBeforeParens: ControlStatementsExceptControlMacros
87SortIncludes: Never
88UseTab: ForContinuationAndIndentation
89WhitespaceSensitiveMacros:
90  - STRINGIFY
91  - Z_STRINGIFY
92