From 2a9d4f887d42d29686fe9e61aa52509a1074dd28 Mon Sep 17 00:00:00 2001 From: heck Date: Tue, 10 Sep 2024 00:35:05 +0200 Subject: [PATCH] Tooling: add essential .clang-format and .clang-tidy --- .clang-format | 42 ++++++++++++++++++++++++++++++++++++++++++ .clang-tidy | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 .clang-format create mode 100644 .clang-tidy diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..0fa41a7 --- /dev/null +++ b/.clang-format @@ -0,0 +1,42 @@ +BasedOnStyle: LLVM +ReflowComments: false + +MacroBlockBegin: "^BEGIN_OPERATOR" +MacroBlockEnd: "^END_OPERATOR" + +Language: Cpp +DerivePointerAlignment: true +SortIncludes: Never +PointerAlignment: Left +AlignAfterOpenBracket: AlwaysBreak +AlignOperands: AlignAfterOperator +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +BinPackArguments: false +BinPackParameters: false +ExperimentalAutoDetectBinPacking: true +BreakBeforeBraces: Custom +BraceWrapping: + AfterFunction: true +ColumnLimit: 100 +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +PenaltyBreakBeforeFirstCallParameter: 0 +PenaltyReturnTypeOnItsOwnLine: 1000000 +PenaltyBreakAssignment: 1000000 +PenaltyExcessCharacter: 10 +IndentCaseLabels: true +IndentWidth: 4 +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: All +SpaceAfterTemplateKeyword: false +AccessModifierOffset: -4 +AllowShortBlocksOnASingleLine: Always +IndentPPDirectives: BeforeHash +IndentExternBlock: Indent +Cpp11BracedListStyle: false diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..1042531 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,36 @@ +Checks: > + -*, + -abseil-*, + -altera-*, + -android-*, + boost-*, + bugprone-*, + cert-*, + clang-analyzer-*, + concurrency-*, + cppcoreguidelines-*, + -cppcoreguidelines-pro-bounds-array-to-pointer-decay, + -cppcoreguidelines-avoid-non-const-global-variables, + -cppcoreguidelines-non-private-member-variables-in-classes, + darwin-*, + -fuchsia-*, + -google-*, + -hicpp-*, + -linuxkernel-*, + -llvm-*, + -llvmlibc-*, + misc-*, + -misc-non-private-member-variables-in-classes, + modernize-*, + -modernize-use-auto, + -modernize-use-trailing-return-type, + -modernize-use-nodiscard, + -mpi-*, + -objc-*, + -openmp-*, + performance-*, + portability-*, + readability-*, + -readability-function-cognitive-complexity, + -readability-implicit-bool-conversion,a + -zircon-*,