mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-01-27 06:58:17 +01:00
652472d059
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
38 lines
652 B
PHP
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();
|
|
}
|
|
}
|
|
}
|