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

(stable) Promote 2016 Week 18

This commit is contained in:
epriestley 2016-04-30 05:01:28 -07:00
commit 6d175516f5
13 changed files with 29 additions and 16 deletions

View file

@ -33,8 +33,7 @@ final class ArcanistClosureLinter extends ArcanistExternalLinter {
return pht(
'Install %s using `%s`.',
'gjslint',
'sudo easy_install http://closure-linter.googlecode.com/'.
'files/closure_linter-latest.tar.gz');
'pip install closure-linter');
}
protected function parseLinterOutput($path, $err, $stdout, $stderr) {

View file

@ -45,7 +45,7 @@ final class ArcanistFlake8Linter extends ArcanistExternalLinter {
}
public function getInstallInstructions() {
return pht('Install flake8 using `%s`.', 'easy_install flake8');
return pht('Install flake8 using `%s`.', 'pip install flake8');
}
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
@ -91,12 +91,13 @@ final class ArcanistFlake8Linter extends ArcanistExternalLinter {
} else {
// "E": PEP8 Error
// "F": PyFlakes Error
// or: Flake8 Extension Message
return ArcanistLintSeverity::SEVERITY_ERROR;
}
}
protected function getLintCodeFromLinterConfigurationKey($code) {
if (!preg_match('/^(E|W|C|F)\d+$/', $code)) {
if (!preg_match('/^[A-Z]\d+$/', $code)) {
throw new Exception(
pht(
'Unrecognized lint message code "%s". Expected a valid flake8 '.

View file

@ -574,8 +574,10 @@ abstract class ArcanistLinter extends Phobject {
case 'standard':
$standards = (array)$value;
foreach ($standards as $standard) {
$standard = ArcanistLinterStandard::getStandard($value, $this);
foreach ($standards as $standard_name) {
$standard = ArcanistLinterStandard::getStandard(
$standard_name,
$this);
foreach ($standard->getLinterConfiguration() as $k => $v) {
$this->setLinterConfigurationValue($k, $v);

View file

@ -43,7 +43,7 @@ final class ArcanistPEP8Linter extends ArcanistExternalLinter {
}
public function getInstallInstructions() {
return pht('Install PEP8 using `%s`.', 'easy_install pep8');
return pht('Install PEP8 using `%s`.', 'pip install pep8');
}
protected function parseLinterOutput($path, $err, $stdout, $stderr) {

View file

@ -14,7 +14,7 @@ final class ArcanistAbstractMethodBodyXHPASTLinterRule
foreach ($methods as $method) {
$modifiers = $this->getModifiers($method);
$body = $method->getChildByIndex(5);
$body = $method->getChildByIndex(6);
if (idx($modifiers, 'abstract') && $body->getTypeName() != 'n_EMPTY') {
$this->raiseLintAtNode(

View file

@ -16,7 +16,7 @@ final class ArcanistInterfaceMethodBodyXHPASTLinterRule
$methods = $interface->selectDescendantsOfType('n_METHOD_DECLARATION');
foreach ($methods as $method) {
$body = $method->getChildByIndex(5);
$body = $method->getChildByIndex(6);
if ($body->getTypeName() != 'n_EMPTY') {
$this->raiseLintAtNode(

View file

@ -46,7 +46,7 @@ final class ArcanistReusedAsIteratorXHPASTLinterRule
$vars[] = $var;
}
$body = $def->getChildByIndex(5);
$body = $def->getChildByIndex(6);
if ($body->getTypeName() === 'n_EMPTY') {
// Abstract method declaration.
continue;

View file

@ -31,7 +31,7 @@ final class ArcanistReusedIteratorReferenceXHPASTLinterRule
));
foreach ($defs as $def) {
$body = $def->getChildByIndex(5);
$body = $def->getChildByIndex(6);
if ($body->getTypeName() === 'n_EMPTY') {
// Abstract method declaration.
continue;

View file

@ -40,7 +40,7 @@ final class ArcanistStaticThisXHPASTLinterRule
continue;
}
$body = $method->getChildOfType(5, 'n_STATEMENT_LIST');
$body = $method->getChildOfType(6, 'n_STATEMENT_LIST');
$variables = $body->selectDescendantsOfType('n_VARIABLE');
foreach ($variables as $variable) {

View file

@ -21,7 +21,7 @@ final class ArcanistToStringExceptionXHPASTLinterRule
continue;
}
$statements = $method->getChildByIndex(5);
$statements = $method->getChildByIndex(6);
if ($statements->getTypeName() != 'n_STATEMENT_LIST') {
continue;

View file

@ -88,7 +88,7 @@ final class ArcanistUndeclaredVariableXHPASTLinterRule
$vars[] = $var;
}
$body = $def->getChildByIndex(5);
$body = $def->getChildByIndex(6);
if ($body->getTypeName() === 'n_EMPTY') {
// Abstract method declaration.
continue;

View file

@ -40,7 +40,7 @@ final class ArcanistUselessOverridingMethodXHPASTLinterRule
$parameters[] = $parameter->getConcreteString();
}
$statements = $method->getChildByIndex(5);
$statements = $method->getChildByIndex(6);
if ($statements->getTypeName() != 'n_STATEMENT_LIST') {
continue;

View file

@ -8,8 +8,19 @@ abstract class ArcanistXHPASTLinterRuleTestCase
extends ArcanistLinterTestCase {
final protected function getLinter() {
// Always include this rule so we get good messages if a test includes
// a syntax error. No normal test should contain syntax errors.
$syntax_rule = new ArcanistSyntaxErrorXHPASTLinterRule();
$test_rule = $this->getLinterRule();
$rules = array(
$syntax_rule,
$test_rule,
);
return id(new ArcanistXHPASTLinter())
->setRules(array($this->getLinterRule()));
->setRules($rules);
}
/**