2021-12-17 23:16:48 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2018-10-04 20:21:59 +08:00
|
|
|
#
|
2021-12-17 23:16:48 +08:00
|
|
|
# Note: The list of ForEachMacros can be obtained using:
|
2018-10-04 20:21:59 +08:00
|
|
|
#
|
2021-12-17 23:16:48 +08:00
|
|
|
# git grep -h '^#define [^[:space:]]*FOR_EACH[^[:space:]]*(' include/ \
|
|
|
|
# | sed "s,^#define \([^[:space:]]*FOR_EACH[^[:space:]]*\)(.*$, - '\1'," \
|
|
|
|
# | sort | uniq
|
2018-10-04 20:21:59 +08:00
|
|
|
#
|
2021-12-17 23:16:48 +08:00
|
|
|
# References:
|
|
|
|
# - https://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
|
|
|
|
2018-10-04 20:21:59 +08:00
|
|
|
---
|
2021-12-17 23:16:48 +08:00
|
|
|
BasedOnStyle: LLVM
|
|
|
|
AlignConsecutiveMacros: AcrossComments
|
2022-07-15 18:23:06 +08:00
|
|
|
AllowShortBlocksOnASingleLine: false
|
|
|
|
AllowShortCaseLabelsOnASingleLine: false
|
2022-07-01 22:46:26 +08:00
|
|
|
AllowShortEnumsOnASingleLine: false
|
2022-07-15 18:23:06 +08:00
|
|
|
AllowShortFunctionsOnASingleLine: None
|
|
|
|
AllowShortIfStatementsOnASingleLine: false
|
|
|
|
AllowShortLoopsOnASingleLine: false
|
2021-12-17 23:16:48 +08:00
|
|
|
AttributeMacros:
|
|
|
|
- __aligned
|
|
|
|
- __deprecated
|
|
|
|
- __packed
|
|
|
|
- __printf_like
|
|
|
|
- __syscall
|
|
|
|
- __subsystem
|
2022-11-16 02:56:54 +08:00
|
|
|
BitFieldColonSpacing: After
|
2021-12-17 23:16:48 +08:00
|
|
|
BreakBeforeBraces: Linux
|
2022-06-28 04:02:21 +08:00
|
|
|
ColumnLimit: 100
|
2018-10-04 20:21:59 +08:00
|
|
|
ConstructorInitializerIndentWidth: 8
|
|
|
|
ContinuationIndentWidth: 8
|
|
|
|
ForEachMacros:
|
|
|
|
- 'FOR_EACH'
|
2020-03-27 00:34:58 +08:00
|
|
|
- 'FOR_EACH_FIXED_ARG'
|
2021-12-17 22:08:25 +08:00
|
|
|
- 'FOR_EACH_IDX'
|
|
|
|
- 'FOR_EACH_IDX_FIXED_ARG'
|
|
|
|
- 'FOR_EACH_NONEMPTY_TERM'
|
2018-10-04 20:21:59 +08:00
|
|
|
- 'RB_FOR_EACH'
|
|
|
|
- 'RB_FOR_EACH_CONTAINER'
|
|
|
|
- 'SYS_DLIST_FOR_EACH_CONTAINER'
|
|
|
|
- 'SYS_DLIST_FOR_EACH_CONTAINER_SAFE'
|
|
|
|
- 'SYS_DLIST_FOR_EACH_NODE'
|
|
|
|
- 'SYS_DLIST_FOR_EACH_NODE_SAFE'
|
|
|
|
- 'SYS_SFLIST_FOR_EACH_CONTAINER'
|
|
|
|
- 'SYS_SFLIST_FOR_EACH_CONTAINER_SAFE'
|
|
|
|
- 'SYS_SFLIST_FOR_EACH_NODE'
|
|
|
|
- 'SYS_SFLIST_FOR_EACH_NODE_SAFE'
|
|
|
|
- 'SYS_SLIST_FOR_EACH_CONTAINER'
|
|
|
|
- 'SYS_SLIST_FOR_EACH_CONTAINER_SAFE'
|
|
|
|
- 'SYS_SLIST_FOR_EACH_NODE'
|
|
|
|
- 'SYS_SLIST_FOR_EACH_NODE_SAFE'
|
2021-12-17 22:08:25 +08:00
|
|
|
- '_WAIT_Q_FOR_EACH'
|
|
|
|
- 'Z_FOR_EACH'
|
|
|
|
- 'Z_FOR_EACH_ENGINE'
|
|
|
|
- 'Z_FOR_EACH_EXEC'
|
|
|
|
- 'Z_FOR_EACH_FIXED_ARG'
|
|
|
|
- 'Z_FOR_EACH_FIXED_ARG_EXEC'
|
|
|
|
- 'Z_FOR_EACH_IDX'
|
|
|
|
- 'Z_FOR_EACH_IDX_EXEC'
|
|
|
|
- 'Z_FOR_EACH_IDX_FIXED_ARG'
|
|
|
|
- 'Z_FOR_EACH_IDX_FIXED_ARG_EXEC'
|
2018-10-04 20:21:59 +08:00
|
|
|
- 'Z_GENLIST_FOR_EACH_CONTAINER'
|
|
|
|
- 'Z_GENLIST_FOR_EACH_CONTAINER_SAFE'
|
|
|
|
- 'Z_GENLIST_FOR_EACH_NODE'
|
|
|
|
- 'Z_GENLIST_FOR_EACH_NODE_SAFE'
|
2022-08-20 02:57:17 +08:00
|
|
|
# Disabled for now, see bug https://github.com/zephyrproject-rtos/zephyr/issues/48520
|
|
|
|
#IncludeBlocks: Regroup
|
2018-10-04 20:21:59 +08:00
|
|
|
IncludeCategories:
|
2021-12-17 23:16:48 +08:00
|
|
|
- Regex: '^".*\.h"$'
|
|
|
|
Priority: 0
|
|
|
|
- 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>$'
|
2018-10-04 20:21:59 +08:00
|
|
|
Priority: 1
|
2021-12-17 23:16:48 +08:00
|
|
|
- Regex: '^\<zephyr/.*\.h\>$'
|
|
|
|
Priority: 2
|
|
|
|
- Regex: '.*'
|
|
|
|
Priority: 3
|
2018-10-04 20:21:59 +08:00
|
|
|
IndentCaseLabels: false
|
|
|
|
IndentWidth: 8
|
2021-12-17 23:16:48 +08:00
|
|
|
# SpaceBeforeParens: ControlStatementsExceptControlMacros # clang-format >= 13.0
|
2022-08-20 02:57:17 +08:00
|
|
|
SortIncludes: false
|
2018-10-04 20:21:59 +08:00
|
|
|
UseTab: Always
|
2021-12-17 23:16:48 +08:00
|
|
|
WhitespaceSensitiveMacros:
|
|
|
|
- STRINGIFY
|
|
|
|
- Z_STRINGIFY
|