]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Provide more help text for `arc linters`
authorepriestley <git@epriestley.com>
Sun, 11 May 2014 23:16:45 +0000 (16:16 -0700)
committerepriestley <git@epriestley.com>
Sun, 11 May 2014 23:16:45 +0000 (16:16 -0700)
Summary: Ref T2039. This isn't exhaustive, but moves things forward by a decent chunk.

Test Plan: Used `arc linters` and read the messages.

Reviewers: chad, btrahan, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Maniphest Tasks: T2039

Differential Revision: https://secure.phabricator.com/D9056

12 files changed:
src/lint/linter/ArcanistCSSLintLinter.php
src/lint/linter/ArcanistFilenameLinter.php
src/lint/linter/ArcanistFlake8Linter.php
src/lint/linter/ArcanistGeneratedLinter.php
src/lint/linter/ArcanistJSHintLinter.php
src/lint/linter/ArcanistJSONLintLinter.php
src/lint/linter/ArcanistLesscLinter.php
src/lint/linter/ArcanistMergeConflictLinter.php
src/lint/linter/ArcanistPuppetLintLinter.php
src/lint/linter/ArcanistPyFlakesLinter.php
src/lint/linter/ArcanistRubyLinter.php
src/lint/linter/ArcanistScriptAndRegexLinter.php

index 78fcbe25aa971b1e4e8ee06ba26eeede383e0b4c..0eb1f0b81bf5cdb6ead24ef75182ded4a803f0ad 100644 (file)
@@ -5,6 +5,19 @@
  */
 final class ArcanistCSSLintLinter extends ArcanistExternalLinter {
 
+  public function getInfoName() {
+    return 'CSSLint';
+  }
+
+  public function getInfoURI() {
+    return 'http://csslint.net';
+  }
+
+  public function getInfoDescription() {
+    return pht(
+      'Use `csslint` to detect issues with CSS source files.');
+  }
+
   public function getLinterName() {
     return 'CSSLint';
   }
index 63de545c8d273b2c9d48691f8a8bb048acb723f3..40d63250ad5911a89c7a1302219ff29e82966630 100644 (file)
@@ -2,13 +2,21 @@
 
 /**
  * Stifles creativity in choosing imaginative file names.
- *
- * @group linter
  */
 final class ArcanistFilenameLinter extends ArcanistLinter {
 
   const LINT_BAD_FILENAME = 1;
 
+  public function getInfoName() {
+    return pht('Filename');
+  }
+
+  public function getInfoDescription() {
+    return pht(
+      'Stifles developer creativity by requiring files have uninspired names '.
+      'containing only letters, numbers, period, hyphen and underscore.');
+  }
+
   public function getLinterName() {
     return 'NAME';
   }
index 3fc905c3146c1144850ed60d7e636e6789f4705d..cfac19c7ba9caa7bfe742afda79868004220feaf 100644 (file)
@@ -3,11 +3,23 @@
 /**
  * Uses "flake8" to detect various errors in Python code.
  * Requires version 1.7.0 or newer of flake8.
- *
- * @group linter
  */
 final class ArcanistFlake8Linter extends ArcanistExternalLinter {
 
+  public function getInfoName() {
+    return 'Flake8';
+  }
+
+  public function getInfoURI() {
+    return 'https://pypi.python.org/pypi/flake8';
+  }
+
+  public function getInfoDescription() {
+    return pht(
+      'Uses `flake8` to run several linters (PyFlakes, pep8, and a McCabe '.
+      'complexity checker) on Python source files.');
+  }
+
   public function getLinterName() {
     return 'flake8';
   }
index 6efdfb15d359f1283eb9864011f97ae911d47580..7cf904504b9e4ef2f61932cb296c820faf4a01c7 100644 (file)
@@ -2,11 +2,20 @@
 
 /**
  * Stops other linters from running on generated code.
- *
- * @group linter
  */
 final class ArcanistGeneratedLinter extends ArcanistLinter {
 
+  public function getInfoName() {
+    return pht('Generated Code');
+  }
+
+  public function getInfoDescription() {
+    return pht(
+      'Disables lint for files that are marked as "%s", indicating that they '.
+      'contain generated code.',
+      '@'.'generated');
+  }
+
   public function getLinterName() {
     return 'GEN';
   }
index 3c241517c0bd1187af2038715f48e99f59d026a0..ef6ec9dba1c4217c54e782e217f299d9339ef076 100644 (file)
@@ -2,11 +2,22 @@
 
 /**
  * Uses JSHint to detect errors and potential problems in JavaScript code.
- *
- * @group linter
  */
 final class ArcanistJSHintLinter extends ArcanistExternalLinter {
 
+  public function getInfoName() {
+    return 'JSHint';
+  }
+
+  public function getInfoURI() {
+    return 'http://www.jshint.com';
+  }
+
+  public function getInfoDescription() {
+    return pht(
+      'Use `jshint` to detect issues with Javascript source files.');
+  }
+
   public function getLinterName() {
     return 'JSHint';
   }
index 60276e0cb236e7438effdca0072fefce6912de54..fd49b89cc653f652dbdf24c917ade790554433a0 100644 (file)
@@ -4,6 +4,19 @@
  * A linter for JSON files.
  */
 final class ArcanistJSONLintLinter extends ArcanistExternalLinter {
+
+  public function getInfoName() {
+    return 'JSON Lint';
+  }
+
+  public function getInfoURI() {
+    return 'https://github.com/zaach/jsonlint';
+  }
+
+  public function getInfoDescription() {
+    return pht('Use `jsonlint` to detect syntax errors in JSON files.');
+  }
+
   public function getLinterName() {
     return 'JSON';
   }
index 9b25f9c8a90df0a8c3cdbc6a463ba1206865d2e4..1315e3715f47133338b06bbc5cfdd48029b9665a 100644 (file)
@@ -16,6 +16,20 @@ final class ArcanistLesscLinter extends ArcanistExternalLinter {
   const LINT_PARSE_ERROR     = 6;
   const LINT_SYNTAX_ERROR    = 7;
 
+  public function getInfoName() {
+    return pht('Less');
+  }
+
+  public function getInfoURI() {
+    return 'https://lesscss.org/';
+  }
+
+  public function getInfoDescription() {
+    return pht(
+      'Use the `--lint` mode provided by `lessc` to detect errors in Less '.
+      'source files.');
+  }
+
   public function getLinterName() {
     return 'LESSC';
   }
index 1b4d8d685224cfbc56c28f85baeb2866e71696e3..8144bd1889db9eb82f7fc4767668d1e2a1e2f88a 100644 (file)
@@ -2,12 +2,21 @@
 
 /**
  * Checks files for unresolved merge conflicts.
- *
- * @group linter
  */
 final class ArcanistMergeConflictLinter extends ArcanistLinter {
+
   const LINT_MERGECONFLICT = 1;
 
+  public function getInfoName() {
+    return pht('Merge Conflicts');
+  }
+
+  public function getInfoDescription() {
+    return pht(
+      'Raises errors on unresolved merge conflicts in source files, to catch '.
+      'mistakes where a conflicted file is accidentally marked as resolved.');
+  }
+
   public function getLinterName() {
     return 'MERGECONFLICT';
   }
@@ -31,7 +40,7 @@ final class ArcanistMergeConflictLinter extends ArcanistLinter {
           $lineno + 1,
           0,
           self::LINT_MERGECONFLICT,
-          'This syntax indicates there is an unresolved merge conflict.');
+          pht('This syntax indicates there is an unresolved merge conflict.'));
       }
     }
   }
@@ -44,7 +53,7 @@ final class ArcanistMergeConflictLinter extends ArcanistLinter {
 
   public function getLintNameMap() {
     return array(
-      self::LINT_MERGECONFLICT => 'Unresolved merge conflict',
+      self::LINT_MERGECONFLICT => pht('Unresolved merge conflict'),
     );
   }
 }
index 7dab3ed73e9b1c3b373461250e5112b989c97642..74f6458bc4ebbb17ac7363df7ad90cd2877a8005 100644 (file)
@@ -5,6 +5,20 @@
  */
 final class ArcanistPuppetLintLinter extends ArcanistExternalLinter {
 
+  public function getInfoURI() {
+    return 'http://puppet-lint.com/';
+  }
+
+  public function getInfoName() {
+    return pht('puppet-lint');
+  }
+
+  public function getInfoDescription() {
+    return pht(
+      'Use `puppet-lint` to check that your Puppet manifests conform to '.
+      'the style guide.');
+  }
+
   public function getLinterName() {
     return 'PUPPETLINT';
   }
index 6ca517cb8e9a2a852ae288a846f781476539bc16..7617bf1694baf84054ee4c0067c811b03a1596da 100644 (file)
@@ -2,11 +2,23 @@
 
 /**
  * Uses "PyFlakes" to detect various errors in Python code.
- *
- * @group linter
  */
 final class ArcanistPyFlakesLinter extends ArcanistExternalLinter {
 
+  public function getInfoURI() {
+    return 'https://pypi.python.org/pypi/pyflakes';
+  }
+
+  public function getInfoName() {
+    return pht('PyFlakes');
+  }
+
+  public function getInfoDescription() {
+    return pht(
+      'PyFlakes is a simple program which checks Python source files for '.
+      'errors.');
+  }
+
   public function getLinterName() {
     return 'PYFLAKES';
   }
index 15ba1b72ba1e38c411fe48a09c04b183de32330c..739585d591a22bcba8ff784a08869c9853a17046 100644 (file)
@@ -2,11 +2,21 @@
 
 /**
  * Uses `ruby` to detect various errors in Ruby code.
- *
- * @group linter
  */
 final class ArcanistRubyLinter extends ArcanistExternalLinter {
 
+  public function getInfoURI() {
+    return 'https://www.ruby-lang.org/';
+  }
+
+  public function getInfoName() {
+    return pht('Ruby');
+  }
+
+  public function getInfoDescription() {
+    return pht('Use `ruby` to check for syntax errors in Ruby source files.');
+  }
+
   public function getLinterName() {
     return 'RUBY';
   }
index 978b32f202456c2f3832b87966ea821d8cd305e3..da4ebe1146d0dacdf420a0141f0e5ffed0533631 100644 (file)
@@ -160,6 +160,17 @@ final class ArcanistScriptAndRegexLinter extends ArcanistLinter {
   private $output = array();
 
 
+  public function getInfoName() {
+    return pht('Script and Regex');
+  }
+
+  public function getInfoDescription() {
+    return pht(
+      'Run an external script, then parse its output with a regular '.
+      'expression. This is a generic binding that can be used to '.
+      'run custom lint scripts.');
+  }
+
 /* -(  Linting  )------------------------------------------------------------ */