Page MenuHomePhabricator

D14563.id35243.diff
No OneTemporary

D14563.id35243.diff

diff --git a/src/lint/linter/ArcanistLinter.php b/src/lint/linter/ArcanistLinter.php
--- a/src/lint/linter/ArcanistLinter.php
+++ b/src/lint/linter/ArcanistLinter.php
@@ -57,6 +57,10 @@
return null;
}
+ public function getAdditionalInformation() {
+ return array();
+ }
+
/**
* Return a human-readable linter name.
*
diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php
--- a/src/lint/linter/ArcanistXHPASTLinter.php
+++ b/src/lint/linter/ArcanistXHPASTLinter.php
@@ -46,6 +46,29 @@
return pht('Use XHPAST to enforce coding conventions on PHP source files.');
}
+ public function getAdditionalInformation() {
+ $table = id(new PhutilConsoleTable())
+ ->setBorders(true)
+ ->addColumn('id', array('title' => pht('ID')))
+ ->addColumn('class', array('title' => pht('Class')))
+ ->addColumn('name', array('title' => pht('Name')));
+
+ $rules = $this->rules;
+ ksort($rules);
+
+ foreach ($rules as $id => $rule) {
+ $table->addRow(array(
+ 'id' => $id,
+ 'class' => get_class($rule),
+ 'name' => $rule->getLintName(),
+ ));
+ }
+
+ return array(
+ pht('Linter Rules') => $table->drawConsoleString(),
+ );
+ }
+
public function getLinterName() {
return 'XHP';
}
diff --git a/src/workflow/ArcanistLintersWorkflow.php b/src/workflow/ArcanistLintersWorkflow.php
--- a/src/workflow/ArcanistLintersWorkflow.php
+++ b/src/workflow/ArcanistLintersWorkflow.php
@@ -78,6 +78,7 @@
if ($exact) {
$linter_info = $this->findExactNames($linter_info, $exact);
+
if (!$linter_info) {
$console->writeOut(
"%s\n",
@@ -170,6 +171,16 @@
$print_tail = true;
}
+ $additional = $linter['additional'];
+ foreach ($additional as $title => $body) {
+ $console->writeOut(
+ "\n%s**%s**\n\n",
+ $pad,
+ $title);
+
+ $console->writeOut($body);
+ }
+
if ($print_tail) {
$console->writeOut("\n");
}
@@ -250,6 +261,7 @@
'description' => $linter->getInfoDescription(),
'exception' => $exception,
'options' => $linter->getLinterConfigurationOptions(),
+ 'additional' => $linter->getAdditionalInformation(),
);
}

File Metadata

Mime Type
text/plain
Expires
Sun, Oct 20, 6:57 PM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6737195
Default Alt Text
D14563.id35243.diff (2 KB)

Event Timeline