From 0846c6aff5c4da7b0c3a9f959bf77368329c5775 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Tue, 5 May 2015 20:56:45 +1000 Subject: [PATCH] Remove commit linter 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 | 4 -- src/lint/linter/ArcanistCommitLinter.php | 60 ------------------- .../ArcanistCommitLinterTestCase.php | 9 --- .../__tests__/commit/nocommit-hook.lint-test | 8 --- .../commit/nocommit-nohook.lint-test | 2 - 5 files changed, 83 deletions(-) delete mode 100644 src/lint/linter/ArcanistCommitLinter.php delete mode 100644 src/lint/linter/__tests__/ArcanistCommitLinterTestCase.php delete mode 100644 src/lint/linter/__tests__/commit/nocommit-hook.lint-test delete mode 100644 src/lint/linter/__tests__/commit/nocommit-nohook.lint-test diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index fd4ea67c..a9d9e0ea 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -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 index 5a4c5c26..00000000 --- a/src/lint/linter/ArcanistCommitLinter.php +++ /dev/null @@ -1,60 +0,0 @@ - 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 index e2a54c81..00000000 --- a/src/lint/linter/__tests__/ArcanistCommitLinterTestCase.php +++ /dev/null @@ -1,9 +0,0 @@ -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 index f1e6a148..00000000 --- a/src/lint/linter/__tests__/commit/nocommit-hook.lint-test +++ /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 index 06570b2c..00000000 --- a/src/lint/linter/__tests__/commit/nocommit-nohook.lint-test +++ /dev/null @@ -1,2 +0,0 @@ -@nocommit -~~~~~~~~~~