summaryrefslogtreecommitdiff
path: root/src/libs/qmljs/qmljscheck.cpp
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2011-10-28 15:56:56 +0200
committerChristian Kamm <christian.d.kamm@nokia.com>2011-10-31 09:38:03 +0100
commite733cb2155a551abc7675ab645b1e1582dcefe71 (patch)
tree4332694f500248e9a0a78665dc8283806d1c6d09 /src/libs/qmljs/qmljscheck.cpp
parent5ac449a7083cf8fd07b3e64e6216f9bfafbb88bc (diff)
downloadqt-creator-e733cb2155a551abc7675ab645b1e1582dcefe71.tar.gz
QmlJS checks: Add @enable-all-checks annotation.
It enables all checks, even those that we deem to annoying to be enabled by default. Also fix a bug where some disabled checks had the wrong severity. Change-Id: Id434ad62dabafac979ee2304a85d368b9ea98fa4 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
Diffstat (limited to 'src/libs/qmljs/qmljscheck.cpp')
-rw-r--r--src/libs/qmljs/qmljscheck.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp
index 3d506220d0..1d96942217 100644
--- a/src/libs/qmljs/qmljscheck.cpp
+++ b/src/libs/qmljs/qmljscheck.cpp
@@ -1172,11 +1172,17 @@ void Check::addMessage(Type type, const SourceLocation &location, const QString
void Check::scanCommentsForAnnotations()
{
m_disabledMessageTypesByLine.clear();
-
- // find all disable annotations
const QRegExp disableCommentPattern(Message::suppressionPattern());
+
foreach (const SourceLocation &commentLoc, _doc->engine()->comments()) {
const QString &comment = _doc->source().mid(commentLoc.begin(), commentLoc.length);
+
+ // enable all checks annotation
+ if (comment.contains(QLatin1String("@enable-all-checks"))) {
+ _enabledMessages = Message::allMessageTypes().toSet();
+ }
+
+ // find all disable annotations
int lastOffset = -1;
QList<MessageTypeAndSuppression> disabledMessageTypes;
forever {