]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Always use lint advices
authorvrana <jakubv@fb.com>
Wed, 22 Aug 2012 18:07:41 +0000 (11:07 -0700)
committervrana <jakubv@fb.com>
Wed, 22 Aug 2012 18:49:59 +0000 (11:49 -0700)
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
src/workflow/ArcanistDiffWorkflow.php
src/workflow/ArcanistLintWorkflow.php

index 6779f839026098ca5f5809c8edb528eb95fd089d..c783a36dfabbceef28ce6fc2c922b5b9ecb36605 100644 (file)
@@ -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
index 7d9f292a1e372bd7963078021a62eb7f1fc4ee2d..8a7f1d255691e88d5af110340c05a53d785c943d 100644 (file)
@@ -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 '.
index 89fd54bd88274c49bbdf328e5700e8df40b61282..d2dd3aa4711f8e59e20fb5e5514765a23e93de2f 100644 (file)
@@ -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