1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 00:32:41 +01:00

Rename ArcanistLintRenderer subclasses

Summary: Ref T5655.

Test Plan: `arc lint` and `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D10011
This commit is contained in:
Joshua Spence 2014-07-25 08:16:29 +10:00
parent 9e357d3fd0
commit 76d80faddf
9 changed files with 26 additions and 26 deletions

View file

@ -30,6 +30,7 @@ phutil_register_library_map(array(
'ArcanistCSharpLinter' => 'lint/linter/ArcanistCSharpLinter.php', 'ArcanistCSharpLinter' => 'lint/linter/ArcanistCSharpLinter.php',
'ArcanistCallConduitWorkflow' => 'workflow/ArcanistCallConduitWorkflow.php', 'ArcanistCallConduitWorkflow' => 'workflow/ArcanistCallConduitWorkflow.php',
'ArcanistCapabilityNotSupportedException' => 'workflow/exception/ArcanistCapabilityNotSupportedException.php', 'ArcanistCapabilityNotSupportedException' => 'workflow/exception/ArcanistCapabilityNotSupportedException.php',
'ArcanistCheckstyleXMLLintRenderer' => 'lint/renderer/ArcanistCheckstyleXMLLintRenderer.php',
'ArcanistChmodLinter' => 'lint/linter/ArcanistChmodLinter.php', 'ArcanistChmodLinter' => 'lint/linter/ArcanistChmodLinter.php',
'ArcanistChooseInvalidRevisionException' => 'exception/ArcanistChooseInvalidRevisionException.php', 'ArcanistChooseInvalidRevisionException' => 'exception/ArcanistChooseInvalidRevisionException.php',
'ArcanistChooseNoRevisionsException' => 'exception/ArcanistChooseNoRevisionsException.php', 'ArcanistChooseNoRevisionsException' => 'exception/ArcanistChooseNoRevisionsException.php',
@ -42,10 +43,12 @@ phutil_register_library_map(array(
'ArcanistCommentRemover' => 'parser/ArcanistCommentRemover.php', 'ArcanistCommentRemover' => 'parser/ArcanistCommentRemover.php',
'ArcanistCommentRemoverTestCase' => 'parser/__tests__/ArcanistCommentRemoverTestCase.php', 'ArcanistCommentRemoverTestCase' => 'parser/__tests__/ArcanistCommentRemoverTestCase.php',
'ArcanistCommitWorkflow' => 'workflow/ArcanistCommitWorkflow.php', 'ArcanistCommitWorkflow' => 'workflow/ArcanistCommitWorkflow.php',
'ArcanistCompilerLikeLintRenderer' => 'lint/renderer/ArcanistCompilerLikeLintRenderer.php',
'ArcanistConduitLinter' => 'lint/linter/ArcanistConduitLinter.php', 'ArcanistConduitLinter' => 'lint/linter/ArcanistConduitLinter.php',
'ArcanistConfiguration' => 'configuration/ArcanistConfiguration.php', 'ArcanistConfiguration' => 'configuration/ArcanistConfiguration.php',
'ArcanistConfigurationDrivenLintEngine' => 'lint/engine/ArcanistConfigurationDrivenLintEngine.php', 'ArcanistConfigurationDrivenLintEngine' => 'lint/engine/ArcanistConfigurationDrivenLintEngine.php',
'ArcanistConfigurationManager' => 'configuration/ArcanistConfigurationManager.php', 'ArcanistConfigurationManager' => 'configuration/ArcanistConfigurationManager.php',
'ArcanistConsoleLintRenderer' => 'lint/renderer/ArcanistConsoleLintRenderer.php',
'ArcanistCoverWorkflow' => 'workflow/ArcanistCoverWorkflow.php', 'ArcanistCoverWorkflow' => 'workflow/ArcanistCoverWorkflow.php',
'ArcanistCppcheckLinter' => 'lint/linter/ArcanistCppcheckLinter.php', 'ArcanistCppcheckLinter' => 'lint/linter/ArcanistCppcheckLinter.php',
'ArcanistCppcheckLinterTestCase' => 'lint/linter/__tests__/ArcanistCppcheckLinterTestCase.php', 'ArcanistCppcheckLinterTestCase' => 'lint/linter/__tests__/ArcanistCppcheckLinterTestCase.php',
@ -93,6 +96,7 @@ phutil_register_library_map(array(
'ArcanistJSHintLinterTestCase' => 'lint/linter/__tests__/ArcanistJSHintLinterTestCase.php', 'ArcanistJSHintLinterTestCase' => 'lint/linter/__tests__/ArcanistJSHintLinterTestCase.php',
'ArcanistJSONLintLinter' => 'lint/linter/ArcanistJSONLintLinter.php', 'ArcanistJSONLintLinter' => 'lint/linter/ArcanistJSONLintLinter.php',
'ArcanistJSONLintLinterTestCase' => 'lint/linter/__tests__/ArcanistJSONLintLinterTestCase.php', 'ArcanistJSONLintLinterTestCase' => 'lint/linter/__tests__/ArcanistJSONLintLinterTestCase.php',
'ArcanistJSONLintRenderer' => 'lint/renderer/ArcanistJSONLintRenderer.php',
'ArcanistJSONLinter' => 'lint/linter/ArcanistJSONLinter.php', 'ArcanistJSONLinter' => 'lint/linter/ArcanistJSONLinter.php',
'ArcanistJSONLinterTestCase' => 'lint/linter/__tests__/ArcanistJSONLinterTestCase.php', 'ArcanistJSONLinterTestCase' => 'lint/linter/__tests__/ArcanistJSONLinterTestCase.php',
'ArcanistJscsLinter' => 'lint/linter/ArcanistJscsLinter.php', 'ArcanistJscsLinter' => 'lint/linter/ArcanistJscsLinter.php',
@ -101,18 +105,12 @@ phutil_register_library_map(array(
'ArcanistLesscLinter' => 'lint/linter/ArcanistLesscLinter.php', 'ArcanistLesscLinter' => 'lint/linter/ArcanistLesscLinter.php',
'ArcanistLesscLinterTestCase' => 'lint/linter/__tests__/ArcanistLesscLinterTestCase.php', 'ArcanistLesscLinterTestCase' => 'lint/linter/__tests__/ArcanistLesscLinterTestCase.php',
'ArcanistLiberateWorkflow' => 'workflow/ArcanistLiberateWorkflow.php', 'ArcanistLiberateWorkflow' => 'workflow/ArcanistLiberateWorkflow.php',
'ArcanistLintCheckstyleXMLRenderer' => 'lint/renderer/ArcanistLintCheckstyleXMLRenderer.php',
'ArcanistLintConsoleRenderer' => 'lint/renderer/ArcanistLintConsoleRenderer.php',
'ArcanistLintEngine' => 'lint/engine/ArcanistLintEngine.php', 'ArcanistLintEngine' => 'lint/engine/ArcanistLintEngine.php',
'ArcanistLintJSONRenderer' => 'lint/renderer/ArcanistLintJSONRenderer.php',
'ArcanistLintLikeCompilerRenderer' => 'lint/renderer/ArcanistLintLikeCompilerRenderer.php',
'ArcanistLintMessage' => 'lint/ArcanistLintMessage.php', 'ArcanistLintMessage' => 'lint/ArcanistLintMessage.php',
'ArcanistLintNoneRenderer' => 'lint/renderer/ArcanistLintNoneRenderer.php',
'ArcanistLintPatcher' => 'lint/ArcanistLintPatcher.php', 'ArcanistLintPatcher' => 'lint/ArcanistLintPatcher.php',
'ArcanistLintRenderer' => 'lint/renderer/ArcanistLintRenderer.php', 'ArcanistLintRenderer' => 'lint/renderer/ArcanistLintRenderer.php',
'ArcanistLintResult' => 'lint/ArcanistLintResult.php', 'ArcanistLintResult' => 'lint/ArcanistLintResult.php',
'ArcanistLintSeverity' => 'lint/ArcanistLintSeverity.php', 'ArcanistLintSeverity' => 'lint/ArcanistLintSeverity.php',
'ArcanistLintSummaryRenderer' => 'lint/renderer/ArcanistLintSummaryRenderer.php',
'ArcanistLintWorkflow' => 'workflow/ArcanistLintWorkflow.php', 'ArcanistLintWorkflow' => 'workflow/ArcanistLintWorkflow.php',
'ArcanistLinter' => 'lint/linter/ArcanistLinter.php', 'ArcanistLinter' => 'lint/linter/ArcanistLinter.php',
'ArcanistLinterTestCase' => 'lint/linter/__tests__/ArcanistLinterTestCase.php', 'ArcanistLinterTestCase' => 'lint/linter/__tests__/ArcanistLinterTestCase.php',
@ -127,6 +125,7 @@ phutil_register_library_map(array(
'ArcanistNoEngineException' => 'exception/usage/ArcanistNoEngineException.php', 'ArcanistNoEngineException' => 'exception/usage/ArcanistNoEngineException.php',
'ArcanistNoLintLinter' => 'lint/linter/ArcanistNoLintLinter.php', 'ArcanistNoLintLinter' => 'lint/linter/ArcanistNoLintLinter.php',
'ArcanistNoLintTestCaseMisnamed' => 'lint/linter/__tests__/ArcanistNoLintTestCase.php', 'ArcanistNoLintTestCaseMisnamed' => 'lint/linter/__tests__/ArcanistNoLintTestCase.php',
'ArcanistNoneLintRenderer' => 'lint/renderer/ArcanistNoneLintRenderer.php',
'ArcanistPEP8Linter' => 'lint/linter/ArcanistPEP8Linter.php', 'ArcanistPEP8Linter' => 'lint/linter/ArcanistPEP8Linter.php',
'ArcanistPEP8LinterTestCase' => 'lint/linter/__tests__/ArcanistPEP8LinterTestCase.php', 'ArcanistPEP8LinterTestCase' => 'lint/linter/__tests__/ArcanistPEP8LinterTestCase.php',
'ArcanistPHPCSLinterTestCase' => 'lint/linter/__tests__/ArcanistPHPCSLinterTestCase.php', 'ArcanistPHPCSLinterTestCase' => 'lint/linter/__tests__/ArcanistPHPCSLinterTestCase.php',
@ -164,6 +163,7 @@ phutil_register_library_map(array(
'ArcanistStopWorkflow' => 'workflow/ArcanistStopWorkflow.php', 'ArcanistStopWorkflow' => 'workflow/ArcanistStopWorkflow.php',
'ArcanistSubversionAPI' => 'repository/api/ArcanistSubversionAPI.php', 'ArcanistSubversionAPI' => 'repository/api/ArcanistSubversionAPI.php',
'ArcanistSubversionHookAPI' => 'repository/hookapi/ArcanistSubversionHookAPI.php', 'ArcanistSubversionHookAPI' => 'repository/hookapi/ArcanistSubversionHookAPI.php',
'ArcanistSummaryLintRenderer' => 'lint/renderer/ArcanistSummaryLintRenderer.php',
'ArcanistSvnHookPreCommitWorkflow' => 'workflow/ArcanistSvnHookPreCommitWorkflow.php', 'ArcanistSvnHookPreCommitWorkflow' => 'workflow/ArcanistSvnHookPreCommitWorkflow.php',
'ArcanistTasksWorkflow' => 'workflow/ArcanistTasksWorkflow.php', 'ArcanistTasksWorkflow' => 'workflow/ArcanistTasksWorkflow.php',
'ArcanistTestCase' => 'infrastructure/testing/ArcanistTestCase.php', 'ArcanistTestCase' => 'infrastructure/testing/ArcanistTestCase.php',
@ -231,6 +231,7 @@ phutil_register_library_map(array(
'ArcanistCSharpLinter' => 'ArcanistLinter', 'ArcanistCSharpLinter' => 'ArcanistLinter',
'ArcanistCallConduitWorkflow' => 'ArcanistWorkflow', 'ArcanistCallConduitWorkflow' => 'ArcanistWorkflow',
'ArcanistCapabilityNotSupportedException' => 'Exception', 'ArcanistCapabilityNotSupportedException' => 'Exception',
'ArcanistCheckstyleXMLLintRenderer' => 'ArcanistLintRenderer',
'ArcanistChmodLinter' => 'ArcanistLinter', 'ArcanistChmodLinter' => 'ArcanistLinter',
'ArcanistChooseInvalidRevisionException' => 'Exception', 'ArcanistChooseInvalidRevisionException' => 'Exception',
'ArcanistChooseNoRevisionsException' => 'Exception', 'ArcanistChooseNoRevisionsException' => 'Exception',
@ -242,8 +243,10 @@ phutil_register_library_map(array(
'ArcanistCoffeeLintLinterTestCase' => 'ArcanistArcanistLinterTestCase', 'ArcanistCoffeeLintLinterTestCase' => 'ArcanistArcanistLinterTestCase',
'ArcanistCommentRemoverTestCase' => 'ArcanistTestCase', 'ArcanistCommentRemoverTestCase' => 'ArcanistTestCase',
'ArcanistCommitWorkflow' => 'ArcanistWorkflow', 'ArcanistCommitWorkflow' => 'ArcanistWorkflow',
'ArcanistCompilerLikeLintRenderer' => 'ArcanistLintRenderer',
'ArcanistConduitLinter' => 'ArcanistLinter', 'ArcanistConduitLinter' => 'ArcanistLinter',
'ArcanistConfigurationDrivenLintEngine' => 'ArcanistLintEngine', 'ArcanistConfigurationDrivenLintEngine' => 'ArcanistLintEngine',
'ArcanistConsoleLintRenderer' => 'ArcanistLintRenderer',
'ArcanistCoverWorkflow' => 'ArcanistWorkflow', 'ArcanistCoverWorkflow' => 'ArcanistWorkflow',
'ArcanistCppcheckLinter' => 'ArcanistExternalLinter', 'ArcanistCppcheckLinter' => 'ArcanistExternalLinter',
'ArcanistCppcheckLinterTestCase' => 'ArcanistArcanistLinterTestCase', 'ArcanistCppcheckLinterTestCase' => 'ArcanistArcanistLinterTestCase',
@ -280,6 +283,7 @@ phutil_register_library_map(array(
'ArcanistJSHintLinterTestCase' => 'ArcanistArcanistLinterTestCase', 'ArcanistJSHintLinterTestCase' => 'ArcanistArcanistLinterTestCase',
'ArcanistJSONLintLinter' => 'ArcanistExternalLinter', 'ArcanistJSONLintLinter' => 'ArcanistExternalLinter',
'ArcanistJSONLintLinterTestCase' => 'ArcanistArcanistLinterTestCase', 'ArcanistJSONLintLinterTestCase' => 'ArcanistArcanistLinterTestCase',
'ArcanistJSONLintRenderer' => 'ArcanistLintRenderer',
'ArcanistJSONLinter' => 'ArcanistLinter', 'ArcanistJSONLinter' => 'ArcanistLinter',
'ArcanistJSONLinterTestCase' => 'ArcanistArcanistLinterTestCase', 'ArcanistJSONLinterTestCase' => 'ArcanistArcanistLinterTestCase',
'ArcanistJscsLinter' => 'ArcanistExternalLinter', 'ArcanistJscsLinter' => 'ArcanistExternalLinter',
@ -288,12 +292,6 @@ phutil_register_library_map(array(
'ArcanistLesscLinter' => 'ArcanistExternalLinter', 'ArcanistLesscLinter' => 'ArcanistExternalLinter',
'ArcanistLesscLinterTestCase' => 'ArcanistArcanistLinterTestCase', 'ArcanistLesscLinterTestCase' => 'ArcanistArcanistLinterTestCase',
'ArcanistLiberateWorkflow' => 'ArcanistWorkflow', 'ArcanistLiberateWorkflow' => 'ArcanistWorkflow',
'ArcanistLintCheckstyleXMLRenderer' => 'ArcanistLintRenderer',
'ArcanistLintConsoleRenderer' => 'ArcanistLintRenderer',
'ArcanistLintJSONRenderer' => 'ArcanistLintRenderer',
'ArcanistLintLikeCompilerRenderer' => 'ArcanistLintRenderer',
'ArcanistLintNoneRenderer' => 'ArcanistLintRenderer',
'ArcanistLintSummaryRenderer' => 'ArcanistLintRenderer',
'ArcanistLintWorkflow' => 'ArcanistWorkflow', 'ArcanistLintWorkflow' => 'ArcanistWorkflow',
'ArcanistLinterTestCase' => 'ArcanistPhutilTestCase', 'ArcanistLinterTestCase' => 'ArcanistPhutilTestCase',
'ArcanistLintersWorkflow' => 'ArcanistWorkflow', 'ArcanistLintersWorkflow' => 'ArcanistWorkflow',
@ -306,6 +304,7 @@ phutil_register_library_map(array(
'ArcanistNoEngineException' => 'ArcanistUsageException', 'ArcanistNoEngineException' => 'ArcanistUsageException',
'ArcanistNoLintLinter' => 'ArcanistLinter', 'ArcanistNoLintLinter' => 'ArcanistLinter',
'ArcanistNoLintTestCaseMisnamed' => 'ArcanistLinterTestCase', 'ArcanistNoLintTestCaseMisnamed' => 'ArcanistLinterTestCase',
'ArcanistNoneLintRenderer' => 'ArcanistLintRenderer',
'ArcanistPEP8Linter' => 'ArcanistExternalLinter', 'ArcanistPEP8Linter' => 'ArcanistExternalLinter',
'ArcanistPEP8LinterTestCase' => 'ArcanistArcanistLinterTestCase', 'ArcanistPEP8LinterTestCase' => 'ArcanistArcanistLinterTestCase',
'ArcanistPHPCSLinterTestCase' => 'ArcanistArcanistLinterTestCase', 'ArcanistPHPCSLinterTestCase' => 'ArcanistArcanistLinterTestCase',
@ -340,6 +339,7 @@ phutil_register_library_map(array(
'ArcanistStopWorkflow' => 'ArcanistPhrequentWorkflow', 'ArcanistStopWorkflow' => 'ArcanistPhrequentWorkflow',
'ArcanistSubversionAPI' => 'ArcanistRepositoryAPI', 'ArcanistSubversionAPI' => 'ArcanistRepositoryAPI',
'ArcanistSubversionHookAPI' => 'ArcanistHookAPI', 'ArcanistSubversionHookAPI' => 'ArcanistHookAPI',
'ArcanistSummaryLintRenderer' => 'ArcanistLintRenderer',
'ArcanistSvnHookPreCommitWorkflow' => 'ArcanistWorkflow', 'ArcanistSvnHookPreCommitWorkflow' => 'ArcanistWorkflow',
'ArcanistTasksWorkflow' => 'ArcanistWorkflow', 'ArcanistTasksWorkflow' => 'ArcanistWorkflow',
'ArcanistTestCase' => 'ArcanistPhutilTestCase', 'ArcanistTestCase' => 'ArcanistPhutilTestCase',

View file

@ -3,7 +3,7 @@
/** /**
* Shows lint messages to the user. * Shows lint messages to the user.
*/ */
final class ArcanistLintCheckstyleXMLRenderer extends ArcanistLintRenderer { final class ArcanistCheckstyleXMLLintRenderer extends ArcanistLintRenderer {
private $writer; private $writer;

View file

@ -3,7 +3,7 @@
/** /**
* Shows lint messages to the user. * Shows lint messages to the user.
*/ */
final class ArcanistLintLikeCompilerRenderer extends ArcanistLintRenderer { final class ArcanistCompilerLikeLintRenderer extends ArcanistLintRenderer {
public function renderLintResult(ArcanistLintResult $result) { public function renderLintResult(ArcanistLintResult $result) {
$lines = array(); $lines = array();

View file

@ -3,7 +3,7 @@
/** /**
* Shows lint messages to the user. * Shows lint messages to the user.
*/ */
final class ArcanistLintConsoleRenderer extends ArcanistLintRenderer { final class ArcanistConsoleLintRenderer extends ArcanistLintRenderer {
private $showAutofixPatches = false; private $showAutofixPatches = false;

View file

@ -3,7 +3,7 @@
/** /**
* Shows lint messages to the user. * Shows lint messages to the user.
*/ */
final class ArcanistLintJSONRenderer extends ArcanistLintRenderer { final class ArcanistJSONLintRenderer extends ArcanistLintRenderer {
const LINES_OF_CONTEXT = 3; const LINES_OF_CONTEXT = 3;

View file

@ -1,6 +1,6 @@
<?php <?php
final class ArcanistLintNoneRenderer extends ArcanistLintRenderer { final class ArcanistNoneLintRenderer extends ArcanistLintRenderer {
public function renderLintResult(ArcanistLintResult $result) { public function renderLintResult(ArcanistLintResult $result) {
return ''; return '';

View file

@ -3,7 +3,7 @@
/** /**
* Shows lint messages to the user. * Shows lint messages to the user.
*/ */
final class ArcanistLintSummaryRenderer extends ArcanistLintRenderer { final class ArcanistSummaryLintRenderer extends ArcanistLintRenderer {
public function renderLintResult(ArcanistLintResult $result) { public function renderLintResult(ArcanistLintResult $result) {
$messages = $result->getMessages(); $messages = $result->getMessages();

View file

@ -424,30 +424,30 @@ EOTEXT
switch ($this->getArgument('output')) { switch ($this->getArgument('output')) {
case 'json': case 'json':
$renderer = new ArcanistLintJSONRenderer(); $renderer = new ArcanistJSONLintRenderer();
$prompt_patches = false; $prompt_patches = false;
$apply_patches = $this->getArgument('apply-patches'); $apply_patches = $this->getArgument('apply-patches');
break; break;
case 'summary': case 'summary':
$renderer = new ArcanistLintSummaryRenderer(); $renderer = new ArcanistSummaryLintRenderer();
break; break;
case 'none': case 'none':
$prompt_patches = false; $prompt_patches = false;
$apply_patches = $this->getArgument('apply-patches'); $apply_patches = $this->getArgument('apply-patches');
$renderer = new ArcanistLintNoneRenderer(); $renderer = new ArcanistNoneLintRenderer();
break; break;
case 'compiler': case 'compiler':
$renderer = new ArcanistLintLikeCompilerRenderer(); $renderer = new ArcanistCompilerLikeLintRenderer();
$prompt_patches = false; $prompt_patches = false;
$apply_patches = $this->getArgument('apply-patches'); $apply_patches = $this->getArgument('apply-patches');
break; break;
case 'xml': case 'xml':
$renderer = new ArcanistLintCheckstyleXMLRenderer(); $renderer = new ArcanistCheckstyleXMLLintRenderer();
$prompt_patches = false; $prompt_patches = false;
$apply_patches = $this->getArgument('apply-patches'); $apply_patches = $this->getArgument('apply-patches');
break; break;
default: default:
$renderer = new ArcanistLintConsoleRenderer(); $renderer = new ArcanistConsoleLintRenderer();
$renderer->setShowAutofixPatches($prompt_autofix_patches); $renderer->setShowAutofixPatches($prompt_autofix_patches);
break; break;
} }
@ -539,7 +539,7 @@ EOTEXT
if ($failed) { if ($failed) {
if ($failed instanceof ArcanistNoEffectException) { if ($failed instanceof ArcanistNoEffectException) {
if ($renderer instanceof ArcanistLintNoneRenderer) { if ($renderer instanceof ArcanistNoneLintRenderer) {
return 0; return 0;
} }
} }

View file

@ -217,7 +217,7 @@ EOTEXT
"errors to disable lint for that file.\n\n"); "errors to disable lint for that file.\n\n");
echo phutil_console_wrap($msg); echo phutil_console_wrap($msg);
$renderer = new ArcanistLintConsoleRenderer(); $renderer = new ArcanistConsoleLintRenderer();
foreach ($failures as $result) { foreach ($failures as $result) {
echo $renderer->renderLintResult($result); echo $renderer->renderLintResult($result);
} }