1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-02-03 18:38:26 +01:00
phorge-arcanist/src/lint/linter/ArcanistGeneratedLinter.php
Joshua Spence d2b38cdf94 pht all the things
Summary: `pht`ize almost all strings in rARC.

Test Plan: ¯\_(ツ)_/¯

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: aurelijus, Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12607
2015-05-13 21:00:53 +10:00

42 lines
841 B
PHP

<?php
/**
* Stops other linters from running on generated code.
*/
final class ArcanistGeneratedLinter extends ArcanistLinter {
public function getInfoName() {
return pht('Generated Code');
}
public function getInfoDescription() {
return pht(
'Disables lint for files that are marked as "%s", '.
'indicating that they contain generated code.',
'@'.'generated');
}
public function getLinterName() {
return 'GEN';
}
public function getLinterPriority() {
return 0.25;
}
public function getLinterConfigurationName() {
return 'generated';
}
protected function canCustomizeLintSeverities() {
return false;
}
public function lintPath($path) {
$data = $this->getData($path);
if (preg_match('/@'.'generated/', $data)) {
$this->stopAllLinters();
}
}
}