diff options
author | Sergio Martins <smartins@kde.org> | 2018-09-26 17:41:36 +0100 |
---|---|---|
committer | Sergio Martins <smartins@kde.org> | 2018-09-26 17:41:36 +0100 |
commit | 13eec46c92ead7d60487dfe26c5681839f7b809f (patch) | |
tree | 99652a56ea2aa5a07d74e946721c1a2f699af156 | |
parent | 6e0cf5c30e5ac45d7817a656bfa5b27c2d5d6295 (diff) |
Don't register qstring-from-literal if ast matchers are disabled
Next we need a way for the unit-tests to know that this
check isn't available
CCBUG: 399090
-rw-r--r-- | checks.json | 3 | ||||
-rw-r--r-- | src/Checks.h | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/checks.json b/checks.json index aec842f7..9e69e153 100644 --- a/checks.json +++ b/checks.json @@ -209,7 +209,8 @@ "name" : "qcolor-from-literal", "level" : 0, "categories" : ["performance"], - "visits_stmts" : true + "visits_stmts" : true, + "ifndef" : "CLAZY_DISABLE_AST_MATCHERS" }, { "name" : "qfileinfo-exists", diff --git a/src/Checks.h b/src/Checks.h index 92a660d7..1ea048d9 100644 --- a/src/Checks.h +++ b/src/Checks.h @@ -134,7 +134,9 @@ void CheckManager::registerChecks() registerCheck(check<LambdaInConnect>("lambda-in-connect", CheckLevel0, RegisteredCheck::Option_VisitsStmts)); registerCheck(check<LambdaUniqueConnection>("lambda-unique-connection", CheckLevel0, RegisteredCheck::Option_VisitsStmts)); registerCheck(check<MutableContainerKey>("mutable-container-key", CheckLevel0, RegisteredCheck::Option_VisitsDecls)); +#ifndef CLAZY_DISABLE_AST_MATCHERS registerCheck(check<QColorFromLiteral>("qcolor-from-literal", CheckLevel0, RegisteredCheck::Option_VisitsStmts)); +#endif registerCheck(check<QDateTimeUtc>("qdatetime-utc", CheckLevel0, RegisteredCheck::Option_VisitsStmts)); registerFixIt(1, "fix-qdatetime-utc", "qdatetime-utc"); registerCheck(check<QEnums>("qenums", CheckLevel0, RegisteredCheck::Option_Qt4Incompatible)); |