Page MenuHomePhabricator

D20532.id48962.diff
No OneTemporary

D20532.id48962.diff

diff --git a/src/lint/linter/__tests__/ArcanistLinterTestCase.php b/src/lint/linter/__tests__/ArcanistLinterTestCase.php
--- a/src/lint/linter/__tests__/ArcanistLinterTestCase.php
+++ b/src/lint/linter/__tests__/ArcanistLinterTestCase.php
@@ -186,27 +186,37 @@
$message = new ArcanistLintMessage();
- $severity = idx($parts, 0);
- $line = idx($parts, 1);
- $char = idx($parts, 2);
- $code = idx($parts, 3);
+ $severity = idx($parts, 0);
+ $line = idx($parts, 1);
+ $char = idx($parts, 2);
+ $code = idx($parts, 3);
+ $name = idx($parts, 4);
+ $description = idx($parts, 5);
- if ($severity !== null) {
+ if (strlen($severity)) {
$message->setSeverity($severity);
}
- if ($line !== null) {
+ if (strlen($line)) {
$message->setLine($line);
}
- if ($char !== null) {
+ if (strlen($char)) {
$message->setChar($char);
}
- if ($code !== null) {
+ if (strlen($code)) {
$message->setCode($code);
}
+ if (strlen($name)) {
+ $message->setName($name);
+ }
+
+ if (strlen($description)) {
+ $message->setDescription($description);
+ }
+
$expected_results->addMessage($message);
}
@@ -246,6 +256,20 @@
continue;
}
+ if (!self::compareLintMessageProperty(
+ $expected_message->getName(),
+ $actual_message->getName())) {
+
+ continue;
+ }
+
+ if (!self::compareLintMessageProperty(
+ $expected_message->getDescription(),
+ $actual_message->getDescription())) {
+
+ continue;
+ }
+
$found = true;
unset($surprising[$ii]);
}
@@ -260,14 +284,15 @@
if ($missing) {
foreach ($missing as $message) {
$expected .= sprintf(
- "\n %s: %s %s",
+ "\n %s: %s %s: %s",
pht(
'%s at line %d, char %d',
$message->getSeverity(),
$message->getLine(),
$message->getChar()),
$message->getCode(),
- $message->getName());
+ $message->getName(),
+ $message->getDescription());
}
} else {
$expected .= "\n ".pht('No messages');
@@ -277,14 +302,15 @@
if ($surprising) {
foreach ($surprising as $message) {
$actual .= sprintf(
- "\n %s: %s %s",
+ "\n %s: %s %s: %s",
pht(
'%s at line %d, char %d',
$message->getSeverity(),
$message->getLine(),
$message->getChar()),
$message->getCode(),
- $message->getName());
+ $message->getName(),
+ $message->getDescription());
}
} else {
$actual .= "\n ".pht('No messages');
diff --git a/src/lint/linter/xhpast/rules/__tests__/variable-variable/variable-variables.lint-test b/src/lint/linter/xhpast/rules/__tests__/variable-variable/variable-variables.lint-test
--- a/src/lint/linter/xhpast/rules/__tests__/variable-variable/variable-variables.lint-test
+++ b/src/lint/linter/xhpast/rules/__tests__/variable-variable/variable-variables.lint-test
@@ -3,4 +3,4 @@
$$foo;
$obj->$bar; // okay
~~~~~~~~~~
-error:3:1:XHP3:Use of Variable
+error:3:1:XHP3:Use of Variable Variable

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 5, 10:43 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6735998
Default Alt Text
D20532.id48962.diff (3 KB)

Event Timeline