mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-01-24 21:48:20 +01:00
9bd740b1f8
Summary: The `ArcanistGeneratedLinter` and `ArcanistNoLintLinter` don't actually ever raise any linter messages, so it doesn't make sense to set custom severities for these linters. Instead, don't expose this configuration. Test Plan: N/A Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9038
42 lines
844 B
PHP
42 lines
844 B
PHP
<?php
|
|
|
|
/**
|
|
* Stops other linters from running on code marked with a nolint annotation.
|
|
*/
|
|
final class ArcanistNoLintLinter extends ArcanistLinter {
|
|
|
|
public function getInfoName() {
|
|
return pht('Lint Disabler');
|
|
}
|
|
|
|
public function getInfoDescription() {
|
|
return pht(
|
|
'Allows you to disable all lint messages for a file by putting "%s" in '.
|
|
'the file body.',
|
|
'@'.'nolint');
|
|
}
|
|
|
|
public function getLinterName() {
|
|
return 'NOLINT';
|
|
}
|
|
|
|
public function getLinterPriority() {
|
|
return 0.25;
|
|
}
|
|
|
|
public function getLinterConfigurationName() {
|
|
return 'nolint';
|
|
}
|
|
|
|
protected function canCustomizeLintSeverities() {
|
|
return false;
|
|
}
|
|
|
|
public function lintPath($path) {
|
|
$data = $this->getData($path);
|
|
if (preg_match('/@'.'nolint/', $data)) {
|
|
$this->stopAllLinters();
|
|
}
|
|
}
|
|
|
|
}
|