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
'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',
'ArcanistCoffeeLintLinter' => 'ArcanistExternalLinter',
'ArcanistCoffeeLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
'ArcanistCommentRemoverTestCase' => 'ArcanistTestCase',
- 'ArcanistCommitLinter' => 'ArcanistLinter',
- 'ArcanistCommitLinterTestCase' => 'ArcanistLinterTestCase',
'ArcanistCommitWorkflow' => 'ArcanistWorkflow',
'ArcanistCompilerLintRenderer' => 'ArcanistLintRenderer',
'ArcanistComprehensiveLintEngine' => 'ArcanistLintEngine',
+++ /dev/null
-<?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);
- }
- }
-
-}
+++ /dev/null
-<?php
-
-final class ArcanistCommitLinterTestCase extends ArcanistLinterTestCase {
-
- public function testLinter() {
- return $this->executeTestsInDirectory(dirname(__FILE__).'/commit/');
- }
-
-}
+++ /dev/null
-@nocommit
-~~~~~~~~~~
-error:1:1
-~~~~~~~~~~
-~~~~~~~~~~
-{
- "hook": true
-}
+++ /dev/null
-@nocommit
-~~~~~~~~~~