1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-01-27 06:58:17 +01:00
phorge-arcanist/src/lint/linter/ArcanistNoLintLinter.php
epriestley 652472d059 Undumb other generic text linters
Summary:
Make all the broad-spectrum text linters use the new binary check.

I didn't touch `ComprehensiveLintEngine` because it's a nest of vipers and no one has complained; see T2039.

Test Plan: Ran `arc lint` on text files and binaries in a libphutil project (arcanist).

Reviewers: lisp

Reviewed By: lisp

CC: aran

Differential Revision: https://secure.phabricator.com/D5040
2013-02-20 14:36:53 -08:00

38 lines
652 B
PHP

<?php
/**
* Stops other linters from running on code marked with
* a nolint annotation.
*
* @group linter
*/
final class ArcanistNoLintLinter extends ArcanistLinter {
public function willLintPaths(array $paths) {
return;
}
public function getLinterName() {
return 'NOLINT';
}
public function getLintSeverityMap() {
return array();
}
public function getLintNameMap() {
return array(
);
}
public function lintPath($path) {
if ($this->isBinaryFile($path)) {
return;
}
$data = $this->getData($path);
if (preg_match('/@'.'nolint/', $data)) {
$this->stopAllLinters();
}
}
}