1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00

Add a version number to ArcanistXHPASTLinter.

Summary: Fixes T5209. It makes sense for the `ArcanistXHPASTLinter` to implement the `getVersion` method in order to be able to enforce version requirements (as in T4954).

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5209

Differential Revision: https://secure.phabricator.com/D9317
This commit is contained in:
Joshua Spence 2014-05-28 06:33:58 -07:00 committed by epriestley
parent ff97a77786
commit 7b61faa192
3 changed files with 19 additions and 14 deletions

View file

@ -9,6 +9,19 @@ abstract class ArcanistBaseXHPASTLinter extends ArcanistFutureLinter {
private $trees = array();
private $exceptions = array();
final public function getCacheVersion() {
$parts = array();
$parts[] = $this->getVersion();
$path = xhpast_get_binary_path();
if (Filesystem::pathExists($path)) {
$parts[] = md5_file($path);
}
return implode('-', $parts);
}
final protected function raiseLintAtToken(
XHPASTToken $token,
$code,

View file

@ -60,13 +60,9 @@ final class ArcanistPhutilXHPASTLinter extends ArcanistBaseXHPASTLinter {
return 'phutil-xhpast';
}
public function getCacheVersion() {
$version = '2';
$path = xhpast_get_binary_path();
if (Filesystem::pathExists($path)) {
$version .= '-'.md5_file($path);
}
return $version;
public function getVersion() {
// The version number should be incremented whenever a new rule is added.
return '2';
}
public function getLinterConfigurationOptions() {

View file

@ -186,13 +186,9 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
return parent::setLinterConfigurationValue($key, $value);
}
public function getCacheVersion() {
$version = '5';
$path = xhpast_get_binary_path();
if (Filesystem::pathExists($path)) {
$version .= '-'.md5_file($path);
}
return $version;
public function getVersion() {
// The version number should be incremented whenever a new rule is added.
return '5';
}
protected function resolveFuture($path, Future $future) {