]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Remove commit linter
authorJoshua Spence <josh@joshuaspence.com>
Tue, 5 May 2015 10:56:45 +0000 (20:56 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Tue, 5 May 2015 10:56:45 +0000 (20:56 +1000)
Summary: Ref T7674. This linter doesn't make sense without commit hooks.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T7674

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

src/__phutil_library_map__.php
src/lint/linter/ArcanistCommitLinter.php [deleted file]
src/lint/linter/__tests__/ArcanistCommitLinterTestCase.php [deleted file]
src/lint/linter/__tests__/commit/nocommit-hook.lint-test [deleted file]
src/lint/linter/__tests__/commit/nocommit-nohook.lint-test [deleted file]

index fd4ea67c3bffefe32a653e89ba61ce499038fed1..a9d9e0ea99d426456df0acaca93510a26d3957b1 100644 (file)
@@ -40,8 +40,6 @@ phutil_register_library_map(array(
     'ArcanistCoffeeLintLinterTestCase' => 'lint/linter/__tests__/ArcanistCoffeeLintLinterTestCase.php',
     'ArcanistCommentRemover' => 'parser/ArcanistCommentRemover.php',
     'ArcanistCommentRemoverTestCase' => 'parser/__tests__/ArcanistCommentRemoverTestCase.php',
-    'ArcanistCommitLinter' => 'lint/linter/ArcanistCommitLinter.php',
-    'ArcanistCommitLinterTestCase' => 'lint/linter/__tests__/ArcanistCommitLinterTestCase.php',
     'ArcanistCommitWorkflow' => 'workflow/ArcanistCommitWorkflow.php',
     'ArcanistCompilerLintRenderer' => 'lint/renderer/ArcanistCompilerLintRenderer.php',
     'ArcanistComprehensiveLintEngine' => 'lint/engine/ArcanistComprehensiveLintEngine.php',
@@ -247,8 +245,6 @@ phutil_register_library_map(array(
     'ArcanistCoffeeLintLinter' => 'ArcanistExternalLinter',
     'ArcanistCoffeeLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
     'ArcanistCommentRemoverTestCase' => 'ArcanistTestCase',
-    'ArcanistCommitLinter' => 'ArcanistLinter',
-    'ArcanistCommitLinterTestCase' => 'ArcanistLinterTestCase',
     'ArcanistCommitWorkflow' => 'ArcanistWorkflow',
     'ArcanistCompilerLintRenderer' => 'ArcanistLintRenderer',
     'ArcanistComprehensiveLintEngine' => 'ArcanistLintEngine',
diff --git a/src/lint/linter/ArcanistCommitLinter.php b/src/lint/linter/ArcanistCommitLinter.php
deleted file mode 100644 (file)
index 5a4c5c2..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-
-final class ArcanistCommitLinter extends ArcanistLinter {
-
-  const LINT_NO_COMMIT = 1;
-
-  public function getInfoName() {
-    return pht('Commit Linter');
-  }
-
-  public function getInfoDescription() {
-    return pht('Ensures that specially marked files are not committed.');
-  }
-
-  public function getLinterPriority() {
-    return 0.5;
-  }
-
-  public function getLinterName() {
-    return 'COMMIT';
-  }
-
-  public function getLinterConfigurationName() {
-    return 'commit';
-  }
-
-  public function getLintNameMap() {
-    return array(
-      self::LINT_NO_COMMIT => pht('Explicit %s', '@no'.'commit'),
-    );
-  }
-
-  protected function canCustomizeLintSeverities() {
-    return false;
-  }
-
-  public function lintPath($path) {
-    if ($this->getEngine()->getCommitHookMode()) {
-      $this->lintNoCommit($path);
-    }
-  }
-
-  private function lintNoCommit($path) {
-    $data = $this->getData($path);
-
-    $deadly = '@no'.'commit';
-    $offset = strpos($data, $deadly);
-
-    if ($offset !== false) {
-      $this->raiseLintAtOffset(
-        $offset,
-        self::LINT_NO_COMMIT,
-        pht(
-          'This file is explicitly marked as "%s", which blocks commits.',
-          $deadly),
-        $deadly);
-    }
-  }
-
-}
diff --git a/src/lint/linter/__tests__/ArcanistCommitLinterTestCase.php b/src/lint/linter/__tests__/ArcanistCommitLinterTestCase.php
deleted file mode 100644 (file)
index e2a54c8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?php
-
-final class ArcanistCommitLinterTestCase extends ArcanistLinterTestCase {
-
-  public function testLinter() {
-    return $this->executeTestsInDirectory(dirname(__FILE__).'/commit/');
-  }
-
-}
diff --git a/src/lint/linter/__tests__/commit/nocommit-hook.lint-test b/src/lint/linter/__tests__/commit/nocommit-hook.lint-test
deleted file mode 100644 (file)
index f1e6a14..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-@nocommit
-~~~~~~~~~~
-error:1:1
-~~~~~~~~~~
-~~~~~~~~~~
-{
-  "hook": true
-}
diff --git a/src/lint/linter/__tests__/commit/nocommit-nohook.lint-test b/src/lint/linter/__tests__/commit/nocommit-nohook.lint-test
deleted file mode 100644 (file)
index 06570b2..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-@nocommit
-~~~~~~~~~~