2011-02-24 17:59:49 -08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Stops other linters from running on code marked with
|
|
|
|
* a nolint annotation.
|
|
|
|
*
|
|
|
|
* @group linter
|
|
|
|
*/
|
2012-01-31 12:07:05 -08:00
|
|
|
final class ArcanistNoLintLinter extends ArcanistLinter {
|
2011-02-24 17:59:49 -08:00
|
|
|
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) {
|
|
|
|
$data = $this->getData($path);
|
|
|
|
|
|
|
|
if (preg_match('/@'.'nolint/', $data)) {
|
|
|
|
$this->stopAllLinters();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|