Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistFlake8Linter.php
| Show All 10 Lines | final class ArcanistFlake8Linter extends ArcanistExternalLinter { | ||||
| } | } | ||||
| public function getInfoURI() { | public function getInfoURI() { | ||||
| return 'https://pypi.python.org/pypi/flake8'; | return 'https://pypi.python.org/pypi/flake8'; | ||||
| } | } | ||||
| public function getInfoDescription() { | public function getInfoDescription() { | ||||
| return pht( | return pht( | ||||
| 'Uses `flake8` to run several linters (PyFlakes, pep8, and a McCabe '. | 'Uses `%s` to run several linters (PyFlakes, pep8, and a McCabe '. | ||||
| 'complexity checker) on Python source files.'); | 'complexity checker) on Python source files.', | ||||
| 'flake8'); | |||||
| } | } | ||||
| public function getLinterName() { | public function getLinterName() { | ||||
| return 'flake8'; | return 'flake8'; | ||||
| } | } | ||||
| public function getLinterConfigurationName() { | public function getLinterConfigurationName() { | ||||
| return 'flake8'; | return 'flake8'; | ||||
| Show All 21 Lines | public function getVersion() { | ||||
| if (preg_match('/^(?P<version>\d+\.\d+(?:\.\d+)?)\b/', $stdout, $matches)) { | if (preg_match('/^(?P<version>\d+\.\d+(?:\.\d+)?)\b/', $stdout, $matches)) { | ||||
| return $matches['version']; | return $matches['version']; | ||||
| } else { | } else { | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| public function getInstallInstructions() { | public function getInstallInstructions() { | ||||
| return pht('Install flake8 using `easy_install flake8`.'); | return pht('Install flake8 using `%s`.', 'easy_install flake8'); | ||||
| } | } | ||||
| protected function parseLinterOutput($path, $err, $stdout, $stderr) { | protected function parseLinterOutput($path, $err, $stdout, $stderr) { | ||||
| $lines = phutil_split_lines($stdout, false); | $lines = phutil_split_lines($stdout, false); | ||||
| $messages = array(); | $messages = array(); | ||||
| foreach ($lines as $line) { | foreach ($lines as $line) { | ||||
| $matches = null; | $matches = null; | ||||
| ▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines | |||||