1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-01-22 20:51:09 +01:00

Reformat lint severities for readability

Summary: See D3482.

Test Plan: `arc lint`

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3501
This commit is contained in:
epriestley 2012-09-21 12:27:32 -07:00
parent 95c663f461
commit d7edc1021d

View file

@ -85,20 +85,10 @@ class PhutilLintEngine extends ArcanistLintEngine {
$name_linter->addPath($path);
}
$xhpast_linter = new ArcanistXHPASTLinter();
$xhpast_linter->setCustomSeverityMap(
array(
ArcanistXHPASTLinter::LINT_RAGGED_CLASSTREE_EDGE
=> ArcanistLintSeverity::SEVERITY_WARNING,
ArcanistXHPASTLinter::LINT_PHP_53_FEATURES
=> ArcanistLintSeverity::SEVERITY_ERROR,
ArcanistXHPASTLinter::LINT_PHP_54_FEATURES
=> ArcanistLintSeverity::SEVERITY_ERROR,
ArcanistXHPASTLinter::LINT_PHT_WITH_DYNAMIC_STRING
=> ArcanistLintSeverity::SEVERITY_WARNING,
ArcanistXHPASTLinter::LINT_COMMENT_SPACING
=> ArcanistLintSeverity::SEVERITY_ERROR,
));
$xhpast_map = $this->getXHPASTSeverityMap();
$xhpast_linter->setCustomSeverityMap($xhpast_map);
$linters[] = $xhpast_linter;
foreach ($paths as $path) {
if (preg_match('/\.php$/', $path)) {
@ -121,4 +111,17 @@ class PhutilLintEngine extends ArcanistLintEngine {
return $linters;
}
private function getXHPASTSeverityMap() {
$error = ArcanistLintSeverity::SEVERITY_ERROR;
$warning = ArcanistLintSeverity::SEVERITY_WARNING;
return array(
ArcanistXHPASTLinter::LINT_PHP_53_FEATURES => $error,
ArcanistXHPASTLinter::LINT_PHP_54_FEATURES => $error,
ArcanistXHPASTLinter::LINT_PHT_WITH_DYNAMIC_STRING => $error,
ArcanistXHPASTLinter::LINT_COMMENT_SPACING => $error,
ArcanistXHPASTLinter::LINT_RAGGED_CLASSTREE_EDGE => $warning,
);
}
}