Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistPyLintLinter.php
| Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
| * According to ##man pylint##, there are 5 kind of messages: | * According to ##man pylint##, there are 5 kind of messages: | ||||
| * | * | ||||
| * (C) convention, for programming standard violation | * (C) convention, for programming standard violation | ||||
| * (R) refactor, for bad code smell | * (R) refactor, for bad code smell | ||||
| * (W) warning, for python specific problems | * (W) warning, for python specific problems | ||||
| * (E) error, for probable bugs in the code | * (E) error, for probable bugs in the code | ||||
| * (F) fatal, if an error occurred which prevented pylint from | * (F) fatal, if an error occurred which prevented pylint from | ||||
| * doing further processing. | * doing further processing. | ||||
| * | |||||
| * @group linter | |||||
| */ | */ | ||||
| final class ArcanistPyLintLinter extends ArcanistLinter { | final class ArcanistPyLintLinter extends ArcanistLinter { | ||||
| private function getMessageCodeSeverity($code) { | private function getMessageCodeSeverity($code) { | ||||
| $config = $this->getEngine()->getConfigurationManager(); | $config = $this->getEngine()->getConfigurationManager(); | ||||
| $error_regexp = | $error_regexp = $config->getConfigFromAnySource( | ||||
| $config->getConfigFromAnySource('lint.pylint.codes.error'); | 'lint.pylint.codes.error'); | ||||
| $warning_regexp = | $warning_regexp = $config->getConfigFromAnySource( | ||||
| $config->getConfigFromAnySource('lint.pylint.codes.warning'); | 'lint.pylint.codes.warning'); | ||||
| $advice_regexp = | $advice_regexp = $config->getConfigFromAnySource( | ||||
| $config->getConfigFromAnySource('lint.pylint.codes.advice'); | 'lint.pylint.codes.advice'); | ||||
| if (!$error_regexp && !$warning_regexp && !$advice_regexp) { | if (!$error_regexp && !$warning_regexp && !$advice_regexp) { | ||||
| throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
| "You are invoking the PyLint linter but have not configured any of ". | "You are invoking the PyLint linter but have not configured any of ". | ||||
| "'lint.pylint.codes.error', 'lint.pylint.codes.warning', or ". | "'lint.pylint.codes.error', 'lint.pylint.codes.warning', or ". | ||||
| "'lint.pylint.codes.advice'. Consult the documentation for ". | "'lint.pylint.codes.advice'. Consult the documentation for ". | ||||
| "ArcanistPyLintLinter."); | "ArcanistPyLintLinter."); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 196 Lines • Show Last 20 Lines | |||||