From 8f6b2835821868dfe0a3e4f418dd9ee582d2f058 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 14 Dec 2020 16:37:14 +0100 Subject: [PATCH] Try to describe our coding style using clang-format How to use: Install 'git-format-clang' which is part of the clang suite (Fedora: git-clang-format, openSUSE: clang-tools). Now do your changes and stage them with `git add`. Once they are staged format the code using `git clang-format` before you commit. Now the formatting changed can be viewed with `git diff` against the staged changes. Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- .clang-format | 25 +++++++++++++++++++++++++ .gitignore | 1 - 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..e2611777 --- /dev/null +++ b/.clang-format @@ -0,0 +1,25 @@ +# https://clang.llvm.org/docs/ClangFormatStyleOptions.html +BasedOnStyle: LLVM +IndentWidth: 4 +UseTab: Never +AllowShortIfStatementsOnASingleLine: false +BreakBeforeBraces: Custom +BraceWrapping: + AfterEnum: false + AfterFunction: true + AfterStruct: false + AfterUnion: false + AfterExternBlock: true + BeforeElse: false + BeforeWhile: false +IndentCaseLabels: false +ColumnLimit: 80 +AlignAfterOpenBracket: Align +AllowAllParametersOfDeclarationOnNextLine: false +BinPackArguments: false +BinPackParameters: false +AllowAllArgumentsOnNextLine: false +AllowShortFunctionsOnASingleLine: Empty +AlwaysBreakAfterReturnType: None +AlignEscapedNewlines: Left +ForEachMacros: ['ssh_callbacks_iterate'] diff --git a/.gitignore b/.gitignore index c8a7348a..47eb46ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *.a *.o -.* *.swp *~$ cscope.*