]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Remove the `PhutilLintEngine` class.
authorJoshua Spence <josh@joshuaspence.com>
Mon, 19 May 2014 14:50:35 +0000 (07:50 -0700)
committerepriestley <git@epriestley.com>
Mon, 19 May 2014 14:50:35 +0000 (07:50 -0700)
Summary: After D9057 and D9064 this class is no longer used.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

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

src/__phutil_library_map__.php
src/lint/engine/PhutilLintEngine.php [deleted file]

index f9a006ab1e0984c9013973f18f17e8165f8d726e..fb4b787cec6efd65e3e36089f22a082312cfb631 100644 (file)
@@ -192,7 +192,6 @@ phutil_register_library_map(array(
     'PHPUnitTestEngineTestCase' => 'unit/engine/__tests__/PHPUnitTestEngineTestCase.php',
     'PhpunitResultParser' => 'unit/engine/PhpunitResultParser.php',
     'PhpunitTestEngine' => 'unit/engine/PhpunitTestEngine.php',
-    'PhutilLintEngine' => 'lint/engine/PhutilLintEngine.php',
     'PhutilUnitTestEngine' => 'unit/engine/PhutilUnitTestEngine.php',
     'PhutilUnitTestEngineTestCase' => 'unit/engine/__tests__/PhutilUnitTestEngineTestCase.php',
     'PytestTestEngine' => 'unit/engine/PytestTestEngine.php',
@@ -351,7 +350,6 @@ phutil_register_library_map(array(
     'PHPUnitTestEngineTestCase' => 'ArcanistTestCase',
     'PhpunitResultParser' => 'ArcanistBaseTestResultParser',
     'PhpunitTestEngine' => 'ArcanistBaseUnitTestEngine',
-    'PhutilLintEngine' => 'ArcanistLintEngine',
     'PhutilUnitTestEngine' => 'ArcanistBaseUnitTestEngine',
     'PhutilUnitTestEngineTestCase' => 'ArcanistTestCase',
     'PytestTestEngine' => 'ArcanistBaseUnitTestEngine',
diff --git a/src/lint/engine/PhutilLintEngine.php b/src/lint/engine/PhutilLintEngine.php
deleted file mode 100644 (file)
index 2966633..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-
-/**
- * Lint engine which enforces libphutil rules.
- */
-final class PhutilLintEngine extends ArcanistLintEngine {
-
-  public function buildLinters() {
-    $linters = array();
-
-    $paths = $this->getPaths();
-
-    $linters[] = id(new ArcanistPhutilLibraryLinter())->setPaths($paths);
-
-    // Remaining linters operate on file contents and ignore removed files.
-    foreach ($paths as $key => $path) {
-      if (!$this->pathExists($path)) {
-        unset($paths[$key]);
-      }
-      if (preg_match('@^externals/@', $path)) {
-        // Third-party stuff lives in /externals/; don't run lint engines
-        // against it.
-        unset($paths[$key]);
-      }
-      if (preg_match('(\\.lint-test$)', $path)) {
-        // Don't try to lint these, since they're tests for linters and
-        // often have intentional lint errors.
-        unset($paths[$key]);
-      }
-    }
-
-    $linters[] = id(new ArcanistFilenameLinter())->setPaths($paths);
-
-    // Skip directories and lint only regular files in remaining linters.
-    foreach ($paths as $key => $path) {
-      if ($this->getCommitHookMode()) {
-        continue;
-      }
-      if (!is_file($this->getFilePathOnDisk($path))) {
-        unset($paths[$key]);
-      }
-    }
-
-    $linters[] = id(new ArcanistGeneratedLinter())->setPaths($paths);
-    $linters[] = id(new ArcanistNoLintLinter())->setPaths($paths);
-    $linters[] = id(new ArcanistTextLinter())->setPaths($paths);
-    $linters[] = id(new ArcanistSpellingLinter())->setPaths($paths);
-
-    $php_paths = preg_grep('/\.php$/', $paths);
-
-    $xhpast_linter = id(new ArcanistXHPASTLinter())
-      ->setCustomSeverityMap($this->getXHPASTSeverityMap())
-      ->setPaths($php_paths);
-    $linters[] = $xhpast_linter;
-
-    $linters[] = id(new ArcanistPhutilXHPASTLinter())
-      ->setPaths($php_paths);
-
-    $merge_conflict_linter = id(new ArcanistMergeConflictLinter());
-
-    foreach ($paths as $path) {
-      $merge_conflict_linter->addPath($path);
-      $merge_conflict_linter->addData($path, $this->loadData($path));
-    }
-
-    $linters[] = $merge_conflict_linter;
-
-    return $linters;
-  }
-
-  private function getXHPASTSeverityMap() {
-    $error = ArcanistLintSeverity::SEVERITY_ERROR;
-    $warning = ArcanistLintSeverity::SEVERITY_WARNING;
-    $advice = ArcanistLintSeverity::SEVERITY_ADVICE;
-
-    return array(
-      ArcanistXHPASTLinter::LINT_PHP_53_FEATURES          => $error,
-      ArcanistXHPASTLinter::LINT_PHP_54_FEATURES          => $error,
-      ArcanistXHPASTLinter::LINT_COMMENT_SPACING          => $error,
-      ArcanistXHPASTLinter::LINT_RAGGED_CLASSTREE_EDGE    => $warning,
-      ArcanistXHPASTLinter::LINT_TODO_COMMENT             => $advice,
-    );
-  }
-}