Align clang-format a bit closer to established coding style
of the project. Similar to commit 51f9f7ca30
("clang-format: do not put enums in single line")'
Never merge blocks/case/functions/if/loops into a single line.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The amount of options available on clang-format has become quite
extensive over-time, making a dumped file difficult to read or maintain.
In this patch the .clang-format has been re-written by inheriting from
LLVM (default) since most of the options can be re-used to match the
Zephyr/Linux coding style conventions.
Note: The 14 release has interesting options for Zephyr, in
particular, these new settings would be beneficial:
IfMacros:
- CHECKIF
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterForeachMacros: true
AfterIfMacros: true
.clang-format should be periodically updated as new clang-format
releases reach Linux distros.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Update the list of for each macros using the suggested command in the
configuration file.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add .clang-format style from linux kernel to allow easier
style formatting for developers that do not use uncrustify.
You can call "clang-format -style=file -i my_src.c" within the repo
to in-place fix the style.
Signed-off-by: Håkon Alseth <haal@nordicsemi.no>