|
| 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 | +--- |
| 13 | +BasedOnStyle: LLVM |
| 14 | +AlignOperands: Align |
| 15 | +BreakBeforeTernaryOperators: false |
| 16 | +AlignConsecutiveMacros: AcrossComments |
| 17 | +AllowShortBlocksOnASingleLine: Never |
| 18 | +AllowShortCaseLabelsOnASingleLine: false |
| 19 | +AllowShortEnumsOnASingleLine: false |
| 20 | +AllowShortFunctionsOnASingleLine: None |
| 21 | +AllowShortIfStatementsOnASingleLine: false |
| 22 | +AllowShortLoopsOnASingleLine: false |
| 23 | +AttributeMacros: |
| 24 | + - __aligned |
| 25 | + - __deprecated |
| 26 | + - __packed |
| 27 | + - __printf_like |
| 28 | + - __syscall |
| 29 | + - __syscall_always_inline |
| 30 | + - __subsystem |
| 31 | +BitFieldColonSpacing: After |
| 32 | +BreakBeforeBraces: Attach |
| 33 | +ColumnLimit: 100 |
| 34 | +ConstructorInitializerIndentWidth: 4 |
| 35 | +ContinuationIndentWidth: 4 |
| 36 | +ForEachMacros: |
| 37 | + - 'ARRAY_FOR_EACH' |
| 38 | + - 'ARRAY_FOR_EACH_PTR' |
| 39 | + - 'FOR_EACH' |
| 40 | + - 'FOR_EACH_FIXED_ARG' |
| 41 | + - 'FOR_EACH_IDX' |
| 42 | + - 'FOR_EACH_IDX_FIXED_ARG' |
| 43 | + - 'FOR_EACH_NONEMPTY_TERM' |
| 44 | + - 'FOR_EACH_FIXED_ARG_NONEMPTY_TERM' |
| 45 | + - 'RB_FOR_EACH' |
| 46 | + - 'RB_FOR_EACH_CONTAINER' |
| 47 | + - 'SYS_DLIST_FOR_EACH_CONTAINER' |
| 48 | + - 'SYS_DLIST_FOR_EACH_CONTAINER_SAFE' |
| 49 | + - 'SYS_DLIST_FOR_EACH_NODE' |
| 50 | + - 'SYS_DLIST_FOR_EACH_NODE_SAFE' |
| 51 | + - 'SYS_SEM_LOCK' |
| 52 | + - 'SYS_SFLIST_FOR_EACH_CONTAINER' |
| 53 | + - 'SYS_SFLIST_FOR_EACH_CONTAINER_SAFE' |
| 54 | + - 'SYS_SFLIST_FOR_EACH_NODE' |
| 55 | + - 'SYS_SFLIST_FOR_EACH_NODE_SAFE' |
| 56 | + - 'SYS_SLIST_FOR_EACH_CONTAINER' |
| 57 | + - 'SYS_SLIST_FOR_EACH_CONTAINER_SAFE' |
| 58 | + - 'SYS_SLIST_FOR_EACH_NODE' |
| 59 | + - 'SYS_SLIST_FOR_EACH_NODE_SAFE' |
| 60 | + - '_WAIT_Q_FOR_EACH' |
| 61 | + - 'Z_FOR_EACH' |
| 62 | + - 'Z_FOR_EACH_ENGINE' |
| 63 | + - 'Z_FOR_EACH_EXEC' |
| 64 | + - 'Z_FOR_EACH_FIXED_ARG' |
| 65 | + - 'Z_FOR_EACH_FIXED_ARG_EXEC' |
| 66 | + - 'Z_FOR_EACH_IDX' |
| 67 | + - 'Z_FOR_EACH_IDX_EXEC' |
| 68 | + - 'Z_FOR_EACH_IDX_FIXED_ARG' |
| 69 | + - 'Z_FOR_EACH_IDX_FIXED_ARG_EXEC' |
| 70 | + - 'Z_GENLIST_FOR_EACH_CONTAINER' |
| 71 | + - 'Z_GENLIST_FOR_EACH_CONTAINER_SAFE' |
| 72 | + - 'Z_GENLIST_FOR_EACH_NODE' |
| 73 | + - 'Z_GENLIST_FOR_EACH_NODE_SAFE' |
| 74 | + - 'STRUCT_SECTION_FOREACH' |
| 75 | + - 'STRUCT_SECTION_FOREACH_ALTERNATE' |
| 76 | + - 'TYPE_SECTION_FOREACH' |
| 77 | + - 'K_SPINLOCK' |
| 78 | + - 'COAP_RESOURCE_FOREACH' |
| 79 | + - 'COAP_SERVICE_FOREACH' |
| 80 | + - 'COAP_SERVICE_FOREACH_RESOURCE' |
| 81 | + - 'HTTP_RESOURCE_FOREACH' |
| 82 | + - 'HTTP_SERVER_CONTENT_TYPE_FOREACH' |
| 83 | + - 'HTTP_SERVICE_FOREACH' |
| 84 | + - 'HTTP_SERVICE_FOREACH_RESOURCE' |
| 85 | + - 'I3C_BUS_FOR_EACH_I3CDEV' |
| 86 | + - 'I3C_BUS_FOR_EACH_I2CDEV' |
| 87 | + - 'MIN_HEAP_FOREACH' |
| 88 | +IfMacros: |
| 89 | + - 'CHECKIF' |
| 90 | +IncludeCategories: |
| 91 | + - Regex: '^".*\.h"$' |
| 92 | + Priority: 0 |
| 93 | + - 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>$' |
| 94 | + Priority: 1 |
| 95 | + - Regex: '^\<zephyr/.*\.h\>$' |
| 96 | + Priority: 2 |
| 97 | + - Regex: '.*' |
| 98 | + Priority: 3 |
| 99 | +IndentCaseLabels: false |
| 100 | +IndentGotoLabels: false |
| 101 | +IndentWidth: 4 |
| 102 | +InsertBraces: true |
| 103 | +InsertNewlineAtEOF: true |
| 104 | +SpaceBeforeInheritanceColon: true |
| 105 | +SpaceBeforeParens: Always |
| 106 | +SortIncludes: Never |
| 107 | +UseTab: ForContinuationAndIndentation |
| 108 | +TabWidth: 4 |
| 109 | +WhitespaceSensitiveMacros: |
| 110 | + - COND_CODE_0 |
| 111 | + - COND_CODE_1 |
| 112 | + - IF_DISABLED |
| 113 | + - IF_ENABLED |
| 114 | + - LISTIFY |
| 115 | + - STRINGIFY |
| 116 | + - Z_STRINGIFY |
| 117 | + - DT_FOREACH_PROP_ELEM_SEP |
0 commit comments