Added clang-tidy config and cleaned up the code a little.

This commit is contained in:
2024-08-18 13:30:40 +02:00
parent 9f011952c2
commit 6d111904d4
7 changed files with 142 additions and 65 deletions

73
.clang-tidy Normal file
View File

@@ -0,0 +1,73 @@
Checks: '*,
-abseil-*,
-altera-*,
-android-*,
-boost-*,
-darwin-*,
-fuchsia-*,
-google-*,
-hicpp-*,
-linuxkernel-*,
-llvm-*,
-llvmlibc-*,
-mpi-*,
-objc-*,
-zircon-*,
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
-bugprone-unhandled-exception-at-new,
-cert-dcl21-cpp,
-cert-err58-cpp,
-cppcoreguidelines-avoid-capturing-lambda-coroutines,
-cppcoreguidelines-avoid-const-or-ref-data-members,
-cppcoreguidelines-avoid-do-while,
-cppcoreguidelines-avoid-reference-coroutine-parameters,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-member-init,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-static-cast-downcast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-special-member-functions,
-modernize-macro-to-enum,
-misc-include-cleaner,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-use-anonymous-namespace,
-modernize-return-braced-init-list,
-modernize-use-auto,
-modernize-use-trailing-return-type,
-portability-simd-intrinsics,
-readability-avoid-unconditional-preprocessor-if,
-readability-container-data-pointer,
-readability-convert-member-functions-to-static,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-named-parameter,
-readability-redundant-access-specifiers,
-readability-uppercase-literal-suffix,
-readability-use-anyofallof'
CheckOptions:
- key: readability-identifier-length.IgnoredParameterNames
value: '^[xyz]$'
- key: readability-identifier-length.IgnoredLoopCounterNames
value: '^[xyz]$'
- key: readability-identifier-length.IgnoredVariableNames
value: '(it|NO)'
- key: readability-function-cognitive-complexity.Threshold
value: 50
WarningsAsErrors: '*'
HeaderFilterRegex: 'source/*.hpp$'
UseColor: false