mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-26 00:32:41 +01:00
Provide coverage for the xhpast $a->b->c parsing bug exposed by tautolinting the
codebase. Summary: Test Plan: Reviewers: CC:
This commit is contained in:
parent
b3b2da4608
commit
d2b5d9108b
3 changed files with 6 additions and 1 deletions
|
@ -62,7 +62,7 @@ abstract class ArcanistLicenseLinter extends ArcanistLinter {
|
||||||
foreach ($patterns as $pattern) {
|
foreach ($patterns as $pattern) {
|
||||||
if (preg_match($pattern, $data, $matches)) {
|
if (preg_match($pattern, $data, $matches)) {
|
||||||
$expect = rtrim(implode('', array_slice($matches, 1)))."\n".$license;
|
$expect = rtrim(implode('', array_slice($matches, 1)))."\n".$license;
|
||||||
if (rtrim($matches[0]) != rtrim($expect)) {
|
if (trim($matches[0]) != trim($expect)) {
|
||||||
$this->raiseLintAtOffset(
|
$this->raiseLintAtOffset(
|
||||||
0,
|
0,
|
||||||
self::LINT_NO_LICENSE_HEADER,
|
self::LINT_NO_LICENSE_HEADER,
|
||||||
|
|
|
@ -153,6 +153,8 @@ class ArcanistXHPASTLinter extends ArcanistLinter {
|
||||||
'<' => true,
|
'<' => true,
|
||||||
'==' => true,
|
'==' => true,
|
||||||
'===' => true,
|
'===' => true,
|
||||||
|
'!=' => true,
|
||||||
|
'!==' => true,
|
||||||
'>=' => true,
|
'>=' => true,
|
||||||
'>' => true,
|
'>' => true,
|
||||||
);
|
);
|
||||||
|
|
|
@ -12,6 +12,9 @@ if ($y[2] - $y[2]) {
|
||||||
if ($x == $y) {
|
if ($x == $y) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// See xhpast 0.54 -> 0.55.
|
||||||
|
return $a->sub->value < $b->sub->value;
|
||||||
|
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
error:3:5
|
error:3:5
|
||||||
error:6:5
|
error:6:5
|
||||||
|
|
Loading…
Reference in a new issue