Commit 5ac449a7 authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlJS checks: Change suppression annotation to @disable-check.



Change-Id: I913cd757c4f8339a518c947569c5ba651153f1c1
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@nokia.com>
parent 4537e1b8
......@@ -1174,7 +1174,7 @@ void Check::scanCommentsForAnnotations()
m_disabledMessageTypesByLine.clear();
// find all disable annotations
const QRegExp disableCommentPattern(QLatin1String("@disable M(\\d+)"));
const QRegExp disableCommentPattern(Message::suppressionPattern());
foreach (const SourceLocation &commentLoc, _doc->engine()->comments()) {
const QString &comment = _doc->source().mid(commentLoc.begin(), commentLoc.length);
int lastOffset = -1;
......
......@@ -248,5 +248,10 @@ DiagnosticMessage Message::toDiagnosticMessage() const
QString Message::suppressionString() const
{
return QString("@disable M%1").arg(QString::number(type));
return QString("@disable-check M%1").arg(QString::number(type));
}
QRegExp Message::suppressionPattern()
{
return QRegExp(QLatin1String("@disable-check M(\\d+)"));
}
......@@ -36,6 +36,10 @@
#include "qmljs_global.h"
#include "parser/qmljsengine_p.h"
#include <QtCore/QRegExp>
#include <QtCore/QString>
#include <QtCore/QList>
namespace QmlJS {
namespace StaticAnalysis {
......@@ -124,6 +128,7 @@ public:
DiagnosticMessage toDiagnosticMessage() const;
QString suppressionString() const;
static QRegExp suppressionPattern();
AST::SourceLocation location;
QString message;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment