]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fill out some more info functions for libphutil-specific linters
authorepriestley <git@epriestley.com>
Mon, 12 May 2014 12:06:04 +0000 (05:06 -0700)
committerepriestley <git@epriestley.com>
Mon, 12 May 2014 12:06:04 +0000 (05:06 -0700)
Summary: Ref T2039. It looks like "phutil-library" didn't make it over, I'll add that to the other two (unless I'm wrong and this isn't an oversight?).

Test Plan: Used `arc linters` to read help.

Reviewers: btrahan, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Maniphest Tasks: T2039

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

.arclint
src/lint/linter/ArcanistPhutilLibraryLinter.php
src/lint/linter/ArcanistPhutilXHPASTLinter.php
src/lint/linter/ArcanistXHPASTLinter.php

index 12bc55043d1827f6685ae02678ef7761a715b01f..f455265326d350b1fd8078e76e7c672b0c92f51e 100644 (file)
--- a/.arclint
+++ b/.arclint
       "type": "phutil-xhpast",
       "include": "(\\.php$)"
     },
+    "phutil-library": {
+      "type": "phutil-library",
+      "include": "(\\.php$)"
+    },
     "text": {
       "type": "text"
     },
index f67b8fe43793853e7987fd5b618bcfe3c2f2b2ca..bf94344f38be93f3c22eec9d58ebae7a24917a51 100644 (file)
@@ -7,8 +7,6 @@
  *   # If you define a symbol, it must not duplicate another definition.
  *   # If you define a class or interface in a file, it MUST be the only symbol
  *     defined in that file.
- *
- * @group linter
  */
 final class ArcanistPhutilLibraryLinter extends ArcanistLinter {
 
@@ -16,6 +14,20 @@ final class ArcanistPhutilLibraryLinter extends ArcanistLinter {
   const LINT_DUPLICATE_SYMBOL             = 2;
   const LINT_ONE_CLASS_PER_FILE           = 3;
 
+  public function getInfoName() {
+    return 'Phutil Library Linter';
+  }
+
+  public function getInfoDescription() {
+    return pht(
+      'Make sure all the symbols use in a libphutil library are defined and '.
+      'known. This linter is specific to PHP source in libphutil libraries.');
+  }
+
+  public function getLinterConfigurationName() {
+    return 'phutil-library';
+  }
+
   public function getLintNameMap() {
     return array(
       self::LINT_UNKNOWN_SYMBOL         => 'Unknown Symbol',
index 8357134d67e00cfa1db4e11f4d827873509c762a..c14ec7e800151704e8c041f76b9ee3026a185ccb 100644 (file)
@@ -10,6 +10,16 @@ final class ArcanistPhutilXHPASTLinter extends ArcanistBaseXHPASTLinter {
   private $dynamicStringFunctions = array();
   private $dynamicStringClasses = array();
 
+  public function getInfoName() {
+    return 'XHPAST/libphutil Lint';
+  }
+
+  public function getInfoDescription() {
+    return pht(
+      'Use XHPAST to run libphutil-specific rules on a PHP library. This '.
+      'linter is intended for use in Phabricator libraries and extensions.');
+  }
+
   public function setDeprecatedFunctions($map) {
     $this->deprecatedFunctions = $map;
     return $this;
index 8234d9dfb8f6a076c05ee352e42df74c875f75cd..51fd79db0799b872b3812eebf410dfe3c1368609 100644 (file)
@@ -47,6 +47,18 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
   private $naminghook;
   private $switchhook;
 
+  public function getInfoName() {
+    return 'XHPAST Lint';
+  }
+
+  public function getInfoDescription() {
+    return pht(
+      'Use XHPAST to enforce Phabricator coding conventions on PHP source '.
+      'files. This linter is intended for use in Phabricator libraries and '.
+      'extensions, and enforces some Phabricator-specific style rules. It '.
+      'may not work well for general PHP source.');
+  }
+
   public function getLintNameMap() {
     return array(
       self::LINT_PHP_SYNTAX_ERROR          => 'PHP Syntax Error!',