From 129339019f73076f3e218725e56ace74d623a7a7 Mon Sep 17 00:00:00 2001 From: vrana Date: Wed, 22 Aug 2012 11:07:41 -0700 Subject: [PATCH] Always use lint advices Summary: We want to have a class of lint problems which are displayed to author and attached to revision but don't require excuse in diff workflow. Lint advices already serve this purpose but no linters emit them because they need `--advice` flag to be processed. By always enabling advices, we can switch more linters from warnings to advices and don't stop the diff workflow for them. This diff also bumps down default severity of TODO rule. Test Plan: Made lint advice mistake, ran `arc lint`. Reviewers: epriestley Reviewed By: epriestley CC: aran, ide, Korvin Differential Revision: https://secure.phabricator.com/D3364 --- src/lint/linter/ArcanistXHPASTLinter.php | 2 +- src/workflow/ArcanistDiffWorkflow.php | 11 ----------- src/workflow/ArcanistLintWorkflow.php | 10 +--------- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php index 6779f839..c783a36d 100644 --- a/src/lint/linter/ArcanistXHPASTLinter.php +++ b/src/lint/linter/ArcanistXHPASTLinter.php @@ -108,7 +108,7 @@ final class ArcanistXHPASTLinter extends ArcanistLinter { public function getLintSeverityMap() { return array( - self::LINT_TODO_COMMENT => ArcanistLintSeverity::SEVERITY_ADVICE, + self::LINT_TODO_COMMENT => ArcanistLintSeverity::SEVERITY_DISABLED, self::LINT_UNABLE_TO_PARSE => ArcanistLintSeverity::SEVERITY_WARNING, self::LINT_NAMING_CONVENTIONS diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index 7d9f292a..8a7f1d25 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -141,7 +141,6 @@ EOTEXT 'less-context' => null, 'apply-patches' => '--raw disables lint.', 'never-apply-patches' => '--raw disables lint.', - 'advice' => '--raw disables lint.', 'lintall' => '--raw disables lint.', 'create' => '--raw and --create both need stdin. '. @@ -161,7 +160,6 @@ EOTEXT 'less-context' => null, 'apply-patches' => '--raw-command disables lint.', 'never-apply-patches' => '--raw-command disables lint.', - 'advice' => '--raw-command disables lint.', 'lintall' => '--raw-command disables lint.', ), ), @@ -187,7 +185,6 @@ EOTEXT "Do not run lint.", 'conflicts' => array( 'lintall' => '--nolint suppresses lint.', - 'advice' => '--nolint suppresses lint.', 'apply-patches' => '--nolint suppresses lint.', 'never-apply-patches' => '--nolint suppresses lint.', ), @@ -201,7 +198,6 @@ EOTEXT 'message' => '--only does not affect revisions.', 'edit' => '--only does not affect revisions.', 'lintall' => '--only suppresses lint.', - 'advice' => '--only suppresses lint.', 'apply-patches' => '--only suppresses lint.', 'never-apply-patches' => '--only suppresses lint.', ), @@ -246,13 +242,6 @@ EOTEXT 'lint' => true, ), ), - 'advice' => array( - 'help' => - "Raise lint advice in addition to lint warnings and errors.", - 'passthru' => array( - 'lint' => true, - ), - ), 'apply-patches' => array( 'help' => 'Apply patches suggested by lint to the working copy without '. diff --git a/src/workflow/ArcanistLintWorkflow.php b/src/workflow/ArcanistLintWorkflow.php index 89fd54bd..d2dd3aa4 100644 --- a/src/workflow/ArcanistLintWorkflow.php +++ b/src/workflow/ArcanistLintWorkflow.php @@ -92,10 +92,6 @@ EOTEXT "With 'json', show lint warnings in machine-readable JSON format. ". "With 'compiler', show lint warnings in suitable for your editor." ), - 'advice' => array( - 'help' => - "Show lint advice, not just warnings and errors." - ), 'engine' => array( 'param' => 'classname', 'help' => @@ -179,11 +175,7 @@ EOTEXT $this->engine = $engine; $engine->setWorkingCopy($working_copy); - if ($this->getArgument('advice')) { - $engine->setMinimumSeverity(ArcanistLintSeverity::SEVERITY_ADVICE); - } else { - $engine->setMinimumSeverity(ArcanistLintSeverity::SEVERITY_AUTOFIX); - } + $engine->setMinimumSeverity(ArcanistLintSeverity::SEVERITY_ADVICE); // Propagate information about which lines changed to the lint engine. // This is used so that the lint engine can drop warning messages