diff options
author | Sergio Martins <smartins@kde.org> | 2018-03-04 18:09:29 +0000 |
---|---|---|
committer | Sergio Martins <smartins@kde.org> | 2018-03-04 18:27:01 +0000 |
commit | 7d5594ef08eadb172b76f34caa6a6dc3f510c39f (patch) | |
tree | 339fcc31cc898c882e6cc5f0f504ad6befa329b3 | |
parent | 1167bc82fc1b5b8bae7db8c49e4c9e141ea1d88b (diff) |
Move reserve-candiates to level3
As it has quite a few false-positives
-rw-r--r-- | CheckSources.cmake | 2 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | checks.json | 12 | ||||
-rw-r--r-- | src/Checks.h | 4 | ||||
-rw-r--r-- | src/checks/level3/README-reserve-candidates.md (renamed from src/checks/level2/README-reserve-candidates.md) | 0 | ||||
-rw-r--r-- | src/checks/level3/reserve-candidates.cpp (renamed from src/checks/level2/reserve-candidates.cpp) | 0 | ||||
-rw-r--r-- | src/checks/level3/reserve-candidates.h (renamed from src/checks/level2/reserve-candidates.h) | 0 | ||||
-rw-r--r-- | tests/clazy/test_requested_checks.sh.expected | 4 |
8 files changed, 12 insertions, 12 deletions
diff --git a/CheckSources.cmake b/CheckSources.cmake index db01b9f1..b07cb600 100644 --- a/CheckSources.cmake +++ b/CheckSources.cmake @@ -65,12 +65,12 @@ set(CLAZY_CHECKS_SRCS ${CLAZY_CHECKS_SRCS} ${CMAKE_CURRENT_LIST_DIR}/src/checks/level2/missing-typeinfo.cpp ${CMAKE_CURRENT_LIST_DIR}/src/checks/level2/old-style-connect.cpp ${CMAKE_CURRENT_LIST_DIR}/src/checks/level2/qstring-allocations.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/checks/level2/reserve-candidates.cpp ${CMAKE_CURRENT_LIST_DIR}/src/checks/level2/returning-void-expression.cpp ${CMAKE_CURRENT_LIST_DIR}/src/checks/level2/rule-of-three.cpp ${CMAKE_CURRENT_LIST_DIR}/src/checks/level2/virtual-call-ctor.cpp ${CMAKE_CURRENT_LIST_DIR}/src/checks/level3/assert-with-side-effects.cpp ${CMAKE_CURRENT_LIST_DIR}/src/checks/level3/detaching-member.cpp + ${CMAKE_CURRENT_LIST_DIR}/src/checks/level3/reserve-candidates.cpp ${CMAKE_CURRENT_LIST_DIR}/src/checks/level3/thread-with-slots.cpp ) @@ -288,7 +288,6 @@ clazy runs all checks from level1 by default. - [missing-typeinfo](src/checks/level2/README-missing-typeinfo.md) - [old-style-connect](src/checks/level2/README-old-style-connect.md) (fix-old-style-connect) - [qstring-allocations](src/checks/level2/README-qstring-allocations.md) (fix-qlatin1string-allocations,fix-fromLatin1_fromUtf8-allocations,fix-fromCharPtrAllocations) - - [reserve-candidates](src/checks/level2/README-reserve-candidates.md) - [returning-void-expression](src/checks/level2/README-returning-void-expression.md) - [rule-of-three](src/checks/level2/README-rule-of-three.md) - [virtual-call-ctor](src/checks/level2/README-virtual-call-ctor.md) @@ -296,6 +295,7 @@ clazy runs all checks from level1 by default. - Checks from Level 3: - [assert-with-side-effects](src/checks/level3/README-assert-with-side-effects.md) - [detaching-member](src/checks/level3/README-detaching-member.md) + - [reserve-candidates](src/checks/level3/README-reserve-candidates.md) - [thread-with-slots](src/checks/level3/README-thread-with-slots.md) # Selecting which checks to enable diff --git a/checks.json b/checks.json index d75549a5..5606ce6a 100644 --- a/checks.json +++ b/checks.json @@ -488,12 +488,6 @@ "visits_stmts" : true }, { - "name" : "reserve-candidates", - "level" : 2, - "categories" : ["containers"], - "visits_stmts" : true - }, - { "name" : "returning-void-expression", "level" : 2, "categories" : ["readability", "cpp"], @@ -529,6 +523,12 @@ "categories" : ["bug"], "visits_decls" : true, "visits_stmts" : true + }, + { + "name" : "reserve-candidates", + "level" : 3, + "categories" : ["containers"], + "visits_stmts" : true } ] } diff --git a/src/Checks.h b/src/Checks.h index b653bf1a..b819036c 100644 --- a/src/Checks.h +++ b/src/Checks.h @@ -93,12 +93,12 @@ #include "checks/level2/missing-typeinfo.h" #include "checks/level2/old-style-connect.h" #include "checks/level2/qstring-allocations.h" -#include "checks/level2/reserve-candidates.h" #include "checks/level2/returning-void-expression.h" #include "checks/level2/rule-of-three.h" #include "checks/level2/virtual-call-ctor.h" #include "checks/level3/assert-with-side-effects.h" #include "checks/level3/detaching-member.h" +#include "checks/level3/reserve-candidates.h" #include "checks/level3/thread-with-slots.h" template <typename T> @@ -188,11 +188,11 @@ void CheckManager::registerChecks() registerFixIt(1, "fix-qlatin1string-allocations", "qstring-allocations"); registerFixIt(2, "fix-fromLatin1_fromUtf8-allocations", "qstring-allocations"); registerFixIt(4, "fix-fromCharPtrAllocations", "qstring-allocations"); - registerCheck(check<ReserveCandidates>("reserve-candidates", CheckLevel2, RegisteredCheck::Option_VisitsStmts)); registerCheck(check<ReturningVoidExpression>("returning-void-expression", CheckLevel2, RegisteredCheck::Option_VisitsStmts)); registerCheck(check<RuleOfThree>("rule-of-three", CheckLevel2, RegisteredCheck::Option_VisitsDecls)); registerCheck(check<VirtualCallCtor>("virtual-call-ctor", CheckLevel2, RegisteredCheck::Option_VisitsDecls)); registerCheck(check<AssertWithSideEffects>("assert-with-side-effects", CheckLevel3, RegisteredCheck::Option_VisitsStmts)); registerCheck(check<DetachingMember>("detaching-member", CheckLevel3, RegisteredCheck::Option_VisitsStmts)); + registerCheck(check<ReserveCandidates>("reserve-candidates", CheckLevel3, RegisteredCheck::Option_VisitsStmts)); registerCheck(check<ThreadWithSlots>("thread-with-slots", CheckLevel3, RegisteredCheck::Option_VisitsStmts | RegisteredCheck::Option_VisitsDecls)); } diff --git a/src/checks/level2/README-reserve-candidates.md b/src/checks/level3/README-reserve-candidates.md index 6a2c6876..6a2c6876 100644 --- a/src/checks/level2/README-reserve-candidates.md +++ b/src/checks/level3/README-reserve-candidates.md diff --git a/src/checks/level2/reserve-candidates.cpp b/src/checks/level3/reserve-candidates.cpp index 5e20c705..5e20c705 100644 --- a/src/checks/level2/reserve-candidates.cpp +++ b/src/checks/level3/reserve-candidates.cpp diff --git a/src/checks/level2/reserve-candidates.h b/src/checks/level3/reserve-candidates.h index 9b9ed5eb..9b9ed5eb 100644 --- a/src/checks/level2/reserve-candidates.h +++ b/src/checks/level3/reserve-candidates.h diff --git a/tests/clazy/test_requested_checks.sh.expected b/tests/clazy/test_requested_checks.sh.expected index 6ccbd297..1c8d5e14 100644 --- a/tests/clazy/test_requested_checks.sh.expected +++ b/tests/clazy/test_requested_checks.sh.expected @@ -8,7 +8,7 @@ Requested checks: foreach, writing-to-temporary Requested checks: old-style-connect Requested checks: old-style-connect Requested checks: foreach, old-style-connect -Requested checks: auto-unexpected-qstringbuilder, base-class-event, child-event-qobject-cast, connect-3arg-lambda, connect-by-name, connect-non-signal, connect-not-normalized, const-signal-or-slot, container-anti-pattern, copyable-polymorphic, ctor-missing-parent-argument, detaching-temporary, foreach, fully-qualified-moc-types, function-args-by-ref, function-args-by-value, global-const-char-pointer, implicit-casts, incorrect-emit, inefficient-qlist-soft, install-event-filter, lambda-in-connect, lambda-unique-connection, missing-qobject-macro, missing-typeinfo, mutable-container-key, non-pod-global-static, old-style-connect, overridden-signal, post-event, qcolor-from-literal, qdatetime-utc, qdeleteall, qenums, qfileinfo-exists, qgetenv, qhash-namespace, qlatin1string-non-ascii, qmap-with-pointer-key, qproperty-without-notify, qstring-allocations, qstring-arg, qstring-insensitive-allocation, qstring-left, qstring-ref, qt-macros, qvariant-template-instantiation, range-loop, reserve-candidates, returning-data-from-temporary, returning-void-expression, rule-of-three, rule-of-two-soft, skipped-base-method, strict-iterators, temporary-iterator, unused-non-trivial-variable, virtual-call-ctor, virtual-signal, writing-to-temporary, wrong-qglobalstatic +Requested checks: auto-unexpected-qstringbuilder, base-class-event, child-event-qobject-cast, connect-3arg-lambda, connect-by-name, connect-non-signal, connect-not-normalized, const-signal-or-slot, container-anti-pattern, copyable-polymorphic, ctor-missing-parent-argument, detaching-temporary, foreach, fully-qualified-moc-types, function-args-by-ref, function-args-by-value, global-const-char-pointer, implicit-casts, incorrect-emit, inefficient-qlist-soft, install-event-filter, lambda-in-connect, lambda-unique-connection, missing-qobject-macro, missing-typeinfo, mutable-container-key, non-pod-global-static, old-style-connect, overridden-signal, post-event, qcolor-from-literal, qdatetime-utc, qdeleteall, qenums, qfileinfo-exists, qgetenv, qhash-namespace, qlatin1string-non-ascii, qmap-with-pointer-key, qproperty-without-notify, qstring-allocations, qstring-arg, qstring-insensitive-allocation, qstring-left, qstring-ref, qt-macros, qvariant-template-instantiation, range-loop, returning-data-from-temporary, returning-void-expression, rule-of-three, rule-of-two-soft, skipped-base-method, strict-iterators, temporary-iterator, unused-non-trivial-variable, virtual-call-ctor, virtual-signal, writing-to-temporary, wrong-qglobalstatic Requested checks: implicit-casts Requested checks: foreach, implicit-casts Requested checks: old-style-connect @@ -89,7 +89,6 @@ Available checks and FixIts: - missing-typeinfo - old-style-connect (fix-old-style-connect) - qstring-allocations (fix-qlatin1string-allocations,fix-fromLatin1_fromUtf8-allocations,fix-fromCharPtrAllocations) - - reserve-candidates - returning-void-expression - rule-of-three - virtual-call-ctor @@ -97,6 +96,7 @@ Available checks and FixIts: - Checks from level3: - assert-with-side-effects - detaching-member + - reserve-candidates - thread-with-slots If nothing is specified, all checks from level0 and level1 will be run. |