mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-12-23 14:00:55 +01:00
Remove all XHP lint tests from Arcanist
Summary: - Remove XHP tests so I can remove XHP support from XHPAST. - Update license tests so they don't break every year. Test Plan: - Ran all unit tests. Reviewers: btrahan, jungejason Reviewed By: btrahan CC: aran, pad, jungejason, btrahan Maniphest Tasks: T635 Differential Revision: https://secure.phabricator.com/D1318
This commit is contained in:
parent
085aa6093b
commit
6f27c9e693
15 changed files with 29 additions and 107 deletions
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
* Copyright 2012 Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -32,4 +32,9 @@ class ArcanistApacheLicenseLinterTestCase extends ArcanistLinterTestCase {
|
|||
$working_copy);
|
||||
}
|
||||
|
||||
protected function compareTransform($expected, $actual) {
|
||||
$expected = str_replace('YYYY', date('Y'), $expected);
|
||||
return parent::compareTransform($expected, $actual);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ int main(int argv, char **argv) {
|
|||
error:1:1
|
||||
~~~~~~~~~~
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
* Copyright YYYY Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -13,7 +13,7 @@ error:1:1
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
* Copyright YYYY Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -7,7 +7,7 @@ error:1:1
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
* Copyright YYYY Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -9,7 +9,7 @@ error:1:1
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
* Copyright YYYY Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -11,7 +11,7 @@ error:1:1
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
* Copyright YYYY Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -9,7 +9,7 @@ error:1:1
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
* Copyright YYYY Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -9,7 +9,7 @@ error:1:1
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
* Copyright YYYY Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
* Copyright 2012 Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -162,7 +162,7 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
private function compareTransform($expected, $actual) {
|
||||
protected function compareTransform($expected, $actual) {
|
||||
if (!strlen($expected)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ define('pony', 'cute');
|
|||
define($pony, 'cute');
|
||||
define('pony', $cute);
|
||||
define($pony, $cute);
|
||||
<div>define($pony, $cute)</div>;
|
||||
~~~~~~~~~~
|
||||
error:3:8 dynamic define
|
||||
error:5:8 dynamic define
|
||||
|
|
|
@ -1,81 +0,0 @@
|
|||
<?php
|
||||
// This test is just making sure we have undone all of the stream elision that
|
||||
// the default XHP grammar does, since it does certain transformations against
|
||||
// whitespace and entities in the lexer itself. If our parse tree elides
|
||||
// whitespace, the "+" operator trigger on the last line will patch at the wrong
|
||||
// offset and the test will fail.
|
||||
<div
|
||||
id
|
||||
|
||||
=
|
||||
|
||||
{
|
||||
|
||||
$x
|
||||
|
||||
|
||||
}
|
||||
>
|
||||
x
|
||||
|
||||
{
|
||||
$x
|
||||
|
||||
}
|
||||
|
||||
<a />
|
||||
|
||||
&
|
||||
|
||||
'
|
||||
|
||||
"
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
;
|
||||
|
||||
$x+$y;
|
||||
~~~~~~~~~~
|
||||
warning:39:3
|
||||
~~~~~~~~~~
|
||||
<?php
|
||||
// This test is just making sure we have undone all of the stream elision that
|
||||
// the default XHP grammar does, since it does certain transformations against
|
||||
// whitespace and entities in the lexer itself. If our parse tree elides
|
||||
// whitespace, the "+" operator trigger on the last line will patch at the wrong
|
||||
// offset and the test will fail.
|
||||
<div
|
||||
id
|
||||
|
||||
=
|
||||
|
||||
{
|
||||
|
||||
$x
|
||||
|
||||
|
||||
}
|
||||
>
|
||||
x
|
||||
|
||||
{
|
||||
$x
|
||||
|
||||
}
|
||||
|
||||
<a />
|
||||
|
||||
&
|
||||
|
||||
'
|
||||
|
||||
"
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
;
|
||||
|
||||
$x + $y;
|
|
@ -7,7 +7,7 @@ class a {
|
|||
|
||||
interface i { }
|
||||
|
||||
class :XhpStuff { }
|
||||
|
||||
|
||||
function YY($ZZ) { }
|
||||
|
||||
|
@ -17,9 +17,9 @@ class Quack {
|
|||
public function vV($w_w) { }
|
||||
}
|
||||
|
||||
<div class="protected function">const $y;</div>;
|
||||
|
||||
class :ui:lol-whatever:omg { }
|
||||
|
||||
|
||||
|
||||
function () use ($this_is_a_closure) { };
|
||||
|
||||
|
@ -35,7 +35,6 @@ warning:5:19
|
|||
warning:5:21
|
||||
warning:5:25
|
||||
warning:8:11
|
||||
warning:10:7
|
||||
warning:12:10
|
||||
warning:12:13
|
||||
warning:26:12
|
|
@ -5,7 +5,7 @@ q( );
|
|||
g();
|
||||
if ($x) { }
|
||||
else if ( $y ) { }
|
||||
<div>( a b c )</div>;
|
||||
|
||||
$obj->m(
|
||||
$x,
|
||||
$y,
|
||||
|
@ -48,7 +48,7 @@ q();
|
|||
g();
|
||||
if ($x) { }
|
||||
else if ($y) { }
|
||||
<div>( a b c )</div>;
|
||||
|
||||
$obj->m(
|
||||
$x,
|
||||
$y,
|
||||
|
|
|
@ -9,7 +9,7 @@ switch($x) {}
|
|||
if ($x) {}
|
||||
else if ($y) {}
|
||||
else if ($z) {}
|
||||
<strong>if</strong>;
|
||||
|
||||
if ($x) {}
|
||||
if
|
||||
|
||||
|
@ -37,6 +37,6 @@ switch ($x) {}
|
|||
if ($x) {}
|
||||
else if ($y) {}
|
||||
else if ($z) {}
|
||||
<strong>if</strong>;
|
||||
|
||||
if ($x) {}
|
||||
if ($x) {}
|
||||
|
|
|
@ -12,15 +12,15 @@ $a===$b;
|
|||
$a.$b;
|
||||
function x($n=null) { }
|
||||
function x($n = null) { }
|
||||
<div id="id">1+1=2</div>;
|
||||
|
||||
$y /* ! */ += // ?
|
||||
$z;
|
||||
$obj->method();
|
||||
Dog::bark();
|
||||
$prev = ($total == 1) ? $navids[0] : $navids[$total-1];
|
||||
$next = ($total == 1) ? $navids[0] : $navids[$current+1];
|
||||
if ($x instanceof :y:z &&$w) { }
|
||||
if ($x instanceof :y:z && $w) { }
|
||||
if ($x instanceof z &&$w) { }
|
||||
if ($x instanceof z && $w) { }
|
||||
~~~~~~~~~~
|
||||
warning:3:3
|
||||
warning:4:4
|
||||
|
@ -32,7 +32,7 @@ warning:10:3
|
|||
warning:11:3
|
||||
warning:20:52
|
||||
warning:21:54
|
||||
warning:22:24
|
||||
warning:22:21
|
||||
~~~~~~~~~~
|
||||
<?php
|
||||
$a + $b;
|
||||
|
@ -48,12 +48,12 @@ $a === $b;
|
|||
$a.$b;
|
||||
function x($n=null) { }
|
||||
function x($n = null) { }
|
||||
<div id="id">1+1=2</div>;
|
||||
|
||||
$y /* ! */ += // ?
|
||||
$z;
|
||||
$obj->method();
|
||||
Dog::bark();
|
||||
$prev = ($total == 1) ? $navids[0] : $navids[$total - 1];
|
||||
$next = ($total == 1) ? $navids[0] : $navids[$current + 1];
|
||||
if ($x instanceof :y:z && $w) { }
|
||||
if ($x instanceof :y:z && $w) { }
|
||||
if ($x instanceof z && $w) { }
|
||||
if ($x instanceof z && $w) { }
|
||||
|
|
Loading…
Reference in a new issue