From 41555b331c985abb479c00bea0b74390b8ff0d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Fri, 22 Nov 2024 12:36:28 +0100 Subject: [PATCH] add cppcheck and clang-tidy checks --- config/labels/analyzers/clang-tidy.json | 80 +++++++++++++++++++++++++ config/labels/analyzers/cppcheck.json | 15 +++++ 2 files changed, 95 insertions(+) diff --git a/config/labels/analyzers/clang-tidy.json b/config/labels/analyzers/clang-tidy.json index bb52fd319f..57928220d7 100644 --- a/config/labels/analyzers/clang-tidy.json +++ b/config/labels/analyzers/clang-tidy.json @@ -157,6 +157,10 @@ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/android/comparison-in-temp-failure-retry.html", "severity:MEDIUM" ], + "boost-use-ranges": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/boost/use-ranges.html", + "severity:LOW" + ], "boost-use-to-string": [ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/boost/use-to-string.html", "profile:extreme", @@ -194,6 +198,10 @@ "sei-cert:pos44-c", "severity:MEDIUM" ], + "bugprone-bitwise-pointer-cast": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/bugprone/bitwise-pointer-cast.html", + "severity:MEDIUM" + ], "bugprone-bool-pointer-implicit-conversion": [ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/bugprone/bool-pointer-implicit-conversion.html", "profile:default", @@ -453,6 +461,10 @@ "profile:sensitive", "severity:MEDIUM" ], + "bugprone-nondeterministic-pointer-iteration-order": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/bugprone/nondeterministic-pointer-iteration-order.html", + "severity:MEDIUM" + ], "bugprone-optional-value-conversion": [ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/bugprone/optional-value-conversion.html", "profile:default", @@ -466,6 +478,10 @@ "profile:sensitive", "severity:MEDIUM" ], + "bugprone-pointer-arithmetic-on-polymorphic-object": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/bugprone/pointer-arithmetic-on-polymorphic-object.html", + "severity:HIGH" + ], "bugprone-posix-return": [ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/bugprone/posix-return.html", "profile:extreme", @@ -487,6 +503,10 @@ "sei-cert:dcl51-cpp", "severity:LOW" ], + "bugprone-return-const-ref-from-parameter": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/bugprone/return-const-ref-from-parameter.html", + "severity:MEDIUM" + ], "bugprone-shared-ptr-array-mismatch": [ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/bugprone/shared-ptr-array-mismatch.html", "guideline:sei-cert", @@ -643,6 +663,10 @@ "profile:sensitive", "severity:MEDIUM" ], + "bugprone-tagged-union-member-count": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/bugprone/tagged-union-member-count.html", + "severity:MEDIUM" + ], "bugprone-suspicious-stringview-data-usage": [ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-stringview-data-usage.html", "profile:default", @@ -788,6 +812,13 @@ "profile:sensitive", "severity:MEDIUM" ], + "cert-arr39-c": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/cert/arr39-c.html", + "guideline:sei-cert", + "profile:security", + "sei-cert:arr39-c", + "severity:HIGH" + ], "cert-con36-c": [ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/cert/con36-c.html", "severity:MEDIUM" @@ -796,6 +827,13 @@ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/cert/con54-cpp.html", "severity:MEDIUM" ], + "cert-ctr56-cpp": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/cert/ctr56-cpp.html", + "guideline:sei-cert", + "profile:security", + "sei-cert:ctr56-cpp", + "severity:MEDIUM" + ], "cert-dcl03-c": [ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/cert/dcl03-c.html", "guideline:sei-cert", @@ -1292,6 +1330,8 @@ "doc_url:https://clang.llvm.org/docs/DiagnosticsReference.html#wauto-import", "severity:MEDIUM" ], +``` + "clang-diagnostic-auto-storage-class": [ "doc_url:https://clang.llvm.org/docs/DiagnosticsReference.html#wauto-storage-class", "severity:MEDIUM" @@ -5805,6 +5845,22 @@ "sei-cert:pos47-c", "severity:MEDIUM" ], + "cppcheck-eraseIteratorOutOfBounds": [ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/cppcheck/eraseIteratorOutOfBounds.html", "severity:HIGH" ], "cppcheck-eraseIteratorOutOfBoundsCond": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/cppcheck/eraseIteratorOutOfBoundsCond.html", + "severity:HIGH" + ], + "cppcheck-returnByReference": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/cppcheck/returnByReference.html", + "severity:MEDIUM" + ], + "cppcheck-suspiciousFloatingPointCast": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/cppcheck/suspiciousFloatingPointCast.html", + "severity:MEDIUM" + ], + "cppcheck-uselessOverride": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/cppcheck/uselessOverride.html", + "severity:LOW" + ], "cppcoreguidelines-avoid-c-arrays": [ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-c-arrays.html", "profile:extreme", @@ -6732,6 +6788,10 @@ "profile:sensitive", "severity:LOW" ], + "misc-use-internal-linkage": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/misc/use-internal-linkage.html", + "severity:LOW" + ], "misc-virtual-near-miss": [ "doc_url:https://releases.llvm.org/6.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/misc-virtual-near-miss.html", "profile:default", @@ -6785,6 +6845,10 @@ "profile:extreme", "severity:LOW" ], + "modernize-min-max-use-initializer-list": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/modernize/min-max-use-initializer-list.html", + "severity:LOW" + ], "modernize-pass-by-value": [ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/modernize/pass-by-value.html", "profile:extreme", @@ -6897,11 +6961,19 @@ "profile:extreme", "severity:LOW" ], + "modernize-use-ranges": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-ranges.html", + "severity:LOW" + ], "modernize-use-starts-ends-with": [ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-starts-ends-with.html", "profile:extreme", "severity:LOW" ], + "modernize-use-std-format": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-std-format.html", + "severity:LOW" + ], "modernize-use-std-numbers": [ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-std-numbers.html", "profile:extreme", @@ -7117,6 +7189,14 @@ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/portability/std-allocator-const.html", "severity:STYLE" ], + "portability-template-virtual-member-function": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/portability/template-virtual-member-function.html", + "severity:MEDIUM" + ], + "readability-math-missing-parentheses": [ + "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/readability/math-missing-parentheses.html", + "severity:LOW" + ], "readability-avoid-const-params-in-decls": [ "doc_url:https://clang.llvm.org/extra/clang-tidy/checks/readability/avoid-const-params-in-decls.html", "severity:STYLE" diff --git a/config/labels/analyzers/cppcheck.json b/config/labels/analyzers/cppcheck.json index a8739ab65c..b637a75149 100644 --- a/config/labels/analyzers/cppcheck.json +++ b/config/labels/analyzers/cppcheck.json @@ -350,6 +350,12 @@ "profile:sensitive", "severity:HIGH" ], + "cppcheck-eraseIteratorOutOfBounds": [ + "severity:HIGH" + ], + "cppcheck-eraseIteratorOutOfBoundsCond": [ + "severity:HIGH" + ], "cppcheck-exceptDeallocThrow": [ "profile:default", "profile:extreme", @@ -1484,6 +1490,15 @@ "cppcheck-uselessCallsSwap": [ "severity:LOW" ], + "cppcheck-uselessOverride": [ + "severity:STYLE" + ], + "cppcheck-returnByReference": [ + "severity:LOW" + ], + "cppcheck-suspiciousFloatingPointCast": [ + "severity:STYLE" + ], "cppcheck-va_end_missing": [ "profile:default", "profile:extreme",