From 42f746c8d0fdc42fe39350c143bd1bc1667d2eb3 Mon Sep 17 00:00:00 2001 From: Keith Short Date: Tue, 20 Dec 2022 09:16:19 -0700 Subject: [PATCH] clang-format: Enable InsertBraces option Zephyr's coding guidelines require braces on every code block body. Enable InsertBraces option so clang-format automatically adds these braces. Signed-off-by: Keith Short --- .clang-format | 1 + scripts/requirements-extras.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index d68699c2c5..03aca80a67 100644 --- a/.clang-format +++ b/.clang-format @@ -77,6 +77,7 @@ IncludeCategories: Priority: 3 IndentCaseLabels: false IndentWidth: 8 +InsertBraces: true # SpaceBeforeParens: ControlStatementsExceptControlMacros # clang-format >= 13.0 SortIncludes: false UseTab: Always diff --git a/scripts/requirements-extras.txt b/scripts/requirements-extras.txt index 53225eddd3..aef6d1d549 100644 --- a/scripts/requirements-extras.txt +++ b/scripts/requirements-extras.txt @@ -10,7 +10,7 @@ gitlint junit2html # helper for developers - code formatter -clang-format>=1.13x +clang-format>=15.0.0 # Script used to build firmware images for NXP LPC MCUs. lpc_checksum