2011-01-10 00:22:25 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2011-02-19 20:36:08 +01:00
|
|
|
* Stops other linters from running on generated code.
|
|
|
|
*
|
|
|
|
* @group linter
|
2011-01-10 00:22:25 +01:00
|
|
|
*/
|
2012-01-31 21:07:05 +01:00
|
|
|
final class ArcanistGeneratedLinter extends ArcanistLinter {
|
2011-01-10 00:22:25 +01:00
|
|
|
|
|
|
|
public function willLintPaths(array $paths) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getLinterName() {
|
|
|
|
return 'GEN';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getLintSeverityMap() {
|
|
|
|
return array();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getLintNameMap() {
|
|
|
|
return array(
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function lintPath($path) {
|
|
|
|
$data = $this->getData($path);
|
2011-02-25 02:59:49 +01:00
|
|
|
|
|
|
|
if (preg_match('/@'.'generated/', $data)) {
|
2011-01-10 00:22:25 +01:00
|
|
|
$this->stopAllLinters();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|