]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Minor cleanup of linter testing code.
authorJoshua Spence <josh@joshuaspence.com>
Tue, 13 May 2014 13:16:02 +0000 (06:16 -0700)
committerepriestley <git@epriestley.com>
Tue, 13 May 2014 13:16:02 +0000 (06:16 -0700)
Summary:
Just some minor cleaning up, including:

- Removing old annotations for Diviner.
- Renaming some `lint-test` files so that the directory name bears a closer resemblance to that of the linter.
- Remove some useless `return` statements.

Test Plan: `arc unit`.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

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

14 files changed:
src/lint/linter/__tests__/ArcanistArcanistLinterTestCase.php
src/lint/linter/__tests__/ArcanistCpplintLinterTestCase.php
src/lint/linter/__tests__/ArcanistFlake8LinterTestCase.php
src/lint/linter/__tests__/ArcanistLinterTestCase.php
src/lint/linter/__tests__/ArcanistNoLintTestCase.php
src/lint/linter/__tests__/ArcanistPHPCSLinterTestCase.php
src/lint/linter/__tests__/ArcanistPhutilXHPASTLinterTestCase.php
src/lint/linter/__tests__/ArcanistPuppetLintLinterTestCase.php
src/lint/linter/__tests__/ArcanistPyFlakesLinterTestCase.php
src/lint/linter/__tests__/ArcanistRubyLinterTestCase.php
src/lint/linter/__tests__/ArcanistSpellingLinterTestCase.php
src/lint/linter/__tests__/ArcanistTextLinterTestCase.php
src/lint/linter/__tests__/ArcanistXHPASTLinterTestCase.php
src/lint/linter/__tests__/cpplint/googlestyle.lint-test [moved from src/lint/linter/__tests__/cpp/googlestyle.lint-test with 100% similarity]

index d8fa684282b67642ae89970800b247b22de15166..b34237b12c9baaafc33e4679ecdad760787feb94 100644 (file)
@@ -1,8 +1,5 @@
 <?php
 
-/**
- * @group testcase
- */
 abstract class ArcanistArcanistLinterTestCase extends ArcanistLinterTestCase {
 
   protected function getLink($method) {
index e3de16424e93ae2daa16593578c0d28cfac65488..0a71f0e9c54c2b314e9364d9f655b56e152c9365 100644 (file)
@@ -1,15 +1,11 @@
 <?php
-/**
- * Test cases for @{class:ArcanistCpplintLinter}.
- *
- * @group testcase
- */
+
 final class ArcanistCpplintLinterTestCase
   extends ArcanistArcanistLinterTestCase {
 
   public function testCpplintLint() {
     return $this->executeTestsInDirectory(
-      dirname(__FILE__).'/cpp/',
+      dirname(__FILE__).'/cpplint/',
       new ArcanistCpplintLinter());
   }
 
index ec89c04369cd9a990a96d085cdd19ec7c0b7ff93..1c487147f718b3a62b212c8c2b05ef9003f3f4f4 100644 (file)
@@ -1,14 +1,10 @@
 <?php
-/**
- * Test cases for @{class:ArcanistFlake8Linter}.
- *
- * @group testcase
- */
+
 final class ArcanistFlake8LinterTestCase
   extends ArcanistArcanistLinterTestCase {
 
   public function testFlake8Lint() {
-    return $this->executeTestsInDirectory(
+    $this->executeTestsInDirectory(
       dirname(__FILE__).'/flake8/',
       new ArcanistFlake8Linter());
   }
index d3592ea48a679ad8e63bea71de9c6cd3480e1263..d94bc89d2c070ea7be7b1c53e874044f8e95e362 100644 (file)
@@ -2,8 +2,6 @@
 
 /**
  * Facilitates implementation of test cases for @{class:ArcanistLinter}s.
- *
- * @group testcase
  */
 abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
 
@@ -154,7 +152,7 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
       $char = $message->getChar();
       $code = $message->getCode();
       $name = $message->getName();
-      $message_key = $sev.":".$line.":".$char;
+      $message_key = $sev.':'.$line.':'.$char;
       $message_map[$message_key] = $message;
       $seen[] = $message_key;
       $raised[] = "  {$sev} at line {$line}, char {$char}: {$code} {$name}";
@@ -173,7 +171,7 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
     $seen   = array_fill_keys($seen, true);
 
     if (!$raised) {
-      $raised = array("No messages.");
+      $raised = array('No messages.');
     }
     $raised = "Actually raised:\n".implode("\n", $raised);
 
@@ -186,7 +184,6 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
     }
 
     foreach (array_diff_key($seen, $expect) as $surprising => $ignored) {
-
       $message = $message_map[$surprising];
       $message_info = $message->getDescription();
 
@@ -205,6 +202,6 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
     $this->assertEqual(
       $expected,
       $actual,
-      "File as patched by lint did not match the expected patched file.");
+      'File as patched by lint did not match the expected patched file.');
   }
 }
index 1af9279d6183a43818834d7064b7b8cea8c403d4..f7480b07af676c9e9e7797f0d93bd73ceefd6fd1 100644 (file)
@@ -1,13 +1,6 @@
 <?php
 
 /**
- * Test for @{class:ArcanistNoLintLinter}.
- *
- * Not a real test... meant to fail lint
- * if @nolint is not respected.
- *
- * @group testcase
+ * Not a real test... meant to fail lint if @nolint is not respected.
  */
-final class ArcanistNoLintTestCaseMisnamed extends ArcanistLinterTestCase {
-
-}
+final class ArcanistNoLintTestCaseMisnamed extends ArcanistLinterTestCase {}
index 85afaf9b3b29ff86d7f48ef4f79d50af0557e1c9..bde4c8a4796d4fe4a4c8bd772cc1bd165a54fc17 100644 (file)
@@ -3,7 +3,7 @@
 final class ArcanistPHPCSLinterTestCase extends ArcanistArcanistLinterTestCase {
 
   public function testPHPCSLint() {
-    return $this->executeTestsInDirectory(
+    $this->executeTestsInDirectory(
       dirname(__FILE__).'/phpcs/',
       new ArcanistPhpcsLinter());
   }
index f1036583f2757ff5be32a9c7727f0e2c982b5099..0c259d589c9614285f35144b6d402637174e265a 100644 (file)
@@ -1,8 +1,5 @@
 <?php
 
-/**
- * @group testcase
- */
 final class ArcanistPhutilXHPASTLinterTestCase
   extends ArcanistArcanistLinterTestCase {
 
@@ -12,7 +9,7 @@ final class ArcanistPhutilXHPASTLinterTestCase
       'deprecated_function' => 'This function is most likely deprecated.',
     ));
 
-    return $this->executeTestsInDirectory(
+    $this->executeTestsInDirectory(
       dirname(__FILE__).'/phlxhp/',
       $linter);
   }
index 2ce0f1f9bc621aecd9b6eccb4317111d0a4817b0..ced6d25d4239ff2bf3590dabe58aaef3357dcc11 100644 (file)
@@ -4,7 +4,7 @@ final class ArcanistPuppetLintLinterTestCase
   extends ArcanistArcanistLinterTestCase {
 
   public function testPuppetLintLinter() {
-    return $this->executeTestsInDirectory(
+    $this->executeTestsInDirectory(
       dirname(__FILE__).'/puppet-lint/',
       new ArcanistPuppetLintLinter());
   }
index aee341319686f0847d248dbe7c4c1caffec84b9f..7f025a606a4fe2d3e6aadbc3e0296114a70a4dc3 100644 (file)
@@ -4,7 +4,7 @@ final class ArcanistPyFlakesLinterTestCase
   extends ArcanistArcanistLinterTestCase {
 
   public function testPyflakesLinter() {
-    return $this->executeTestsInDirectory(
+    $this->executeTestsInDirectory(
       dirname(__FILE__).'/pyflakes/',
       new ArcanistPyFlakesLinter());
   }
index 4056f35d906a35016e46a3411999c82c30334d1e..e8e37ba5a76972b503f44692f94580b482402d60 100644 (file)
@@ -1,14 +1,9 @@
 <?php
 
-/**
- * Test cases for @{class:ArcanistRubyLinter}.
- *
- * @group testcase
- */
 final class ArcanistRubyLinterTestCase extends ArcanistArcanistLinterTestCase {
 
   public function testRubyLint() {
-    return $this->executeTestsInDirectory(
+    $this->executeTestsInDirectory(
       dirname(__FILE__).'/ruby/',
       new ArcanistRubyLinter());
   }
index 667058fa2b1f1ff803304b754a360d7e73e974ae..6a653274998c565183ffb3c5b5ff1e73556d60a9 100644 (file)
@@ -1,10 +1,5 @@
 <?php
 
-/**
- * Test cases for @{class:ArcanistSpellingLinter}.
- *
- * @group testcase
- */
 final class ArcanistSpellingLinterTestCase
   extends ArcanistArcanistLinterTestCase {
 
@@ -13,7 +8,7 @@ final class ArcanistSpellingLinterTestCase
     $linter->addPartialWordRule('supermn', 'superman');
     $linter->addWholeWordRule('batmn', 'batman');
 
-    return $this->executeTestsInDirectory(
+    $this->executeTestsInDirectory(
       dirname(__FILE__).'/spelling/',
       $linter);
   }
index c9129c6fd14d60e7f2cab9164bd61869ec06c158..5fb6b220a5926b6a397366051609a740e9a43500 100644 (file)
@@ -1,14 +1,9 @@
 <?php
 
-/**
- * Test cases for @{class:ArcanistTextLinter}.
- *
- * @group testcase
- */
 final class ArcanistTextLinterTestCase extends ArcanistArcanistLinterTestCase {
 
   public function testTextLint() {
-    return $this->executeTestsInDirectory(
+    $this->executeTestsInDirectory(
       dirname(__FILE__).'/text/',
       new ArcanistTextLinter());
   }
index 6d3c53c63a7442f3b2b8aa5ee9c8d0f56d14b4b6..1a336d4a1e8b3054a367293a04107929eac139a7 100644 (file)
@@ -1,10 +1,5 @@
 <?php
 
-/**
- * Tests for @{class:ArcanistXHPASTLinter}.
- *
- * @group testcase
- */
 final class ArcanistXHPASTLinterTestCase
   extends ArcanistArcanistLinterTestCase {
 
@@ -17,7 +12,7 @@ final class ArcanistXHPASTLinterTestCase
           => ArcanistLintSeverity::SEVERITY_WARNING,
       ));
 
-    return $this->executeTestsInDirectory(
+    $this->executeTestsInDirectory(
       dirname(__FILE__).'/xhpast/',
       $linter);
   }