From d4f055177eab7f01b4025fbba62a53b65e2ebed8 Mon Sep 17 00:00:00 2001 From: Andreas Fuchs Date: Fri, 26 Apr 2024 15:23:44 +0200 Subject: [PATCH] Add clang-format style for project This adds a .clang-format file for the project. Requires clang-format-17: docker run -u 1000 -v $PWD:$PWD xianpengshen/clang-tools:17 \ clang-format -i $(find -name '*.c' | xargs realpath) Signed-off-by: Andreas Fuchs --- .clang-format | 29 +++++++++++++++++++++++++++++ .git-blame-ignore-revs | 1 + 2 files changed, 30 insertions(+) create mode 100644 .clang-format create mode 100644 .git-blame-ignore-revs diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..d68cbb72e --- /dev/null +++ b/.clang-format @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023-2024 Infineon Technologies AG +# +# SPDX-License-Identifier: BSD-2-clause + +--- + +BasedOnStyle: GNU + +IndentWidth: 4 +ColumnLimit: 100 + +BreakBeforeBraces: Attach + +AlignAfterOpenBracket: Align +AlignConsecutiveDeclarations: true +BinPackParameters: false +AllowAllParametersOfDeclarationOnNextLine: false + +SpaceBeforeParens: ControlStatementsExceptControlMacros +AlignConsecutiveMacros: + Enabled: true + AcrossEmptyLines: true + AcrossComments: false + +Macros: +- statecase(VAR, STATE)=case 0:{} +- general_failure(VAR)=default:{} +- statecasedefault(VAR)=default:{} +- statecasedefault_error(VAR, r, label)=default:{} \ No newline at end of file diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 000000000..a3ad51183 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1 @@ +# .git-blame-ignore-revs