From 0d0cbd8243f53e4a5d69cdd09deb481312441254 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sat, 13 May 2017 15:00:13 -0400 Subject: [PATCH] clang-tidy ignore cert-flp30-c only in tests --- .clang-tidy | 2 - src/systemcmds/tests/.clang-tidy | 74 +++++++++++++++++++++++++++++ src/systemcmds/tests/test_conv.cpp | 2 - src/systemcmds/tests/test_mixer.cpp | 2 +- 4 files changed, 75 insertions(+), 5 deletions(-) create mode 100644 src/systemcmds/tests/.clang-tidy diff --git a/.clang-tidy b/.clang-tidy index 059050644c..5fa0938dd2 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -2,7 +2,6 @@ Checks: '* ,-cert-dcl50-cpp ,-cert-err34-c ,-cert-err58-cpp - ,-cert-flp30-c ,-cert-msc30-c ,-cert-msc50-cpp ,-clang-analyzer-core.CallAndMessage @@ -14,7 +13,6 @@ Checks: '* ,-clang-analyzer-deadcode.DeadStores ,-clang-analyzer-optin.cplusplus.VirtualCall ,-clang-analyzer-optin.performance.Padding - ,-clang-analyzer-security.FloatLoopCounter ,-clang-analyzer-security.insecureAPI.strcpy ,-clang-analyzer-unix.cstring.BadSizeArg ,-clang-analyzer-unix.Malloc diff --git a/src/systemcmds/tests/.clang-tidy b/src/systemcmds/tests/.clang-tidy new file mode 100644 index 0000000000..d51d1a6ae5 --- /dev/null +++ b/src/systemcmds/tests/.clang-tidy @@ -0,0 +1,74 @@ +Checks: '* + ,-cert-dcl50-cpp + ,-cert-err34-c + ,-cert-err58-cpp + ,-cert-flp30-c + ,-cert-msc30-c + ,-cert-msc50-cpp + ,-clang-analyzer-core.CallAndMessage + ,-clang-analyzer-core.NullDereference + ,-clang-analyzer-core.UndefinedBinaryOperatorResult + ,-clang-analyzer-core.uninitialized.Assign + ,-clang-analyzer-core.VLASize + ,-clang-analyzer-cplusplus.NewDeleteLeaks + ,-clang-analyzer-deadcode.DeadStores + ,-clang-analyzer-optin.cplusplus.VirtualCall + ,-clang-analyzer-optin.performance.Padding + ,-clang-analyzer-security.FloatLoopCounter + ,-clang-analyzer-security.insecureAPI.strcpy + ,-clang-analyzer-unix.cstring.BadSizeArg + ,-clang-analyzer-unix.Malloc + ,-clang-analyzer-unix.MallocSizeof + ,-cppcoreguidelines-c-copy-assignment-signature + ,-cppcoreguidelines-interfaces-global-init + ,-cppcoreguidelines-no-malloc + ,-cppcoreguidelines-pro-bounds-array-to-pointer-decay + ,-cppcoreguidelines-pro-bounds-constant-array-index + ,-cppcoreguidelines-pro-bounds-pointer-arithmetic + ,-cppcoreguidelines-pro-type-const-cast + ,-cppcoreguidelines-pro-type-cstyle-cast + ,-cppcoreguidelines-pro-type-member-init + ,-cppcoreguidelines-pro-type-reinterpret-cast + ,-cppcoreguidelines-pro-type-union-access + ,-cppcoreguidelines-pro-type-vararg + ,-cppcoreguidelines-special-member-functions + ,-google-build-using-namespace + ,-google-explicit-constructor + ,-google-global-names-in-headers + ,-google-readability-casting + ,-google-readability-namespace-comments + ,-google-readability-todo + ,-google-runtime-int + ,-google-runtime-references + ,-llvm-header-guard + ,-llvm-include-order + ,-llvm-namespace-comment + ,-misc-incorrect-roundings + ,-misc-macro-parentheses + ,-misc-misplaced-widening-cast + ,-misc-redundant-expression + ,-misc-unconventional-assign-operator + ,-misc-unused-parameters + ,-modernize-deprecated-headers + ,-modernize-loop-convert + ,-modernize-use-auto + ,-modernize-use-bool-literals + ,-modernize-use-default-member-init + ,-modernize-use-emplace + ,-modernize-use-equals-default + ,-modernize-use-equals-delete + ,-modernize-use-override + ,-modernize-use-using + ,-performance-inefficient-string-concatenation + ,-readability-avoid-const-params-in-decls + ,-readability-braces-around-statements + ,-readability-else-after-return + ,-readability-implicit-bool-cast + ,-readability-inconsistent-declaration-parameter-name + ,-readability-named-parameter + ,-readability-non-const-parameter + ,-readability-redundant-declaration + ,-readability-redundant-member-init + ,-readability-simplify-boolean-expr + ' +WarningsAsErrors: '*' diff --git a/src/systemcmds/tests/test_conv.cpp b/src/systemcmds/tests/test_conv.cpp index f6cfaab073..fae383c622 100644 --- a/src/systemcmds/tests/test_conv.cpp +++ b/src/systemcmds/tests/test_conv.cpp @@ -37,8 +37,6 @@ * */ -#include - #include #include diff --git a/src/systemcmds/tests/test_mixer.cpp b/src/systemcmds/tests/test_mixer.cpp index 65368fe985..5ba77a7b50 100644 --- a/src/systemcmds/tests/test_mixer.cpp +++ b/src/systemcmds/tests/test_mixer.cpp @@ -75,7 +75,7 @@ const unsigned output_max = 8; static float actuator_controls[output_max]; static bool should_prearm = false; -#define NAN_VALUE 0.0f/0.0f +#define NAN_VALUE (0.0f/0.0f) #ifdef __PX4_DARWIN #define MIXER_DIFFERENCE_THRESHOLD 30