From a68a606a075c61529344fe0ffa28104af4aeb550 Mon Sep 17 00:00:00 2001 From: Shivesh Mandalia Date: Sat, 16 Apr 2022 18:23:12 +0100 Subject: Add clang-format and clang-tidy files --- .clang-format | 10 ++++++++++ .clang-tidy | 31 +++++++++++++++++++++++++++++++ 2 files changed, 41 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..b07b47c --- /dev/null +++ b/.clang-format @@ -0,0 +1,10 @@ +--- +BasedOnStyle: LLVM +--- +Language: Cpp +DerivePointerAlignment: false +PointerAlignment: Left +AlwaysBreakTemplateDeclarations: Yes +IndentWidth: 8 +UseTab: AlignWithSpaces +--- diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..e225e47 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,31 @@ +--- +Checks: "*, \ + -altera-struct-pack-align, \ + -altera-unroll-loops, \ + -altera-id-dependent-backward-branch, \ + -bugprone-easily-swappable-parameters, \ + -cppcoreguidelines-avoid-magic-numbers, \ + -cppcoreguidelines-non-private-member-variables-in-classes, \ + -fuchsia-default-arguments-calls, \ + -fuchsia-default-arguments-declarations, \ + -fuchsia-overloaded-operator, \ + -fuchsia-trailing-return, \ + -google-build-using-namespace, \ + -google-runtime-int, \ + -llvmlibc-callee-namespace, \ + -llvmlibc-implementation-in-namespace, \ + -llvmlibc-restrict-system-libc-headers, \ + -modernize-use-trailing-return-type, \ + -misc-non-private-member-variables-in-classes, \ + -readability-magic-numbers" +WarningsAsErrors: "*" +HeaderFilterRegex: "." +CheckOptions: + - { key: readability-identifier-naming.ClassCase, value: CamelCase } + - { key: readability-identifier-naming.EnumCase, value: CamelCase } + - { key: readability-identifier-naming.FunctionCase, value: lower_case } + - { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE } + - { key: readability-identifier-naming.NamespaceCase, value: lower_case } + - { key: readability-identifier-naming.PrivateMemberPrefix, value: m_ } + - { key: readability-identifier-naming.StructCase, value: CamelCase } + - { key: readability-function-cognitive-complexity.IgnoreMacros, value: "true" } -- cgit v1.2.3