Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/lint/linter/PhabricatorJavelinLinter.php
| <?php | <?php | ||||
| final class PhabricatorJavelinLinter extends ArcanistLinter { | final class PhabricatorJavelinLinter extends ArcanistLinter { | ||||
| private $symbols = array(); | private $symbols = array(); | ||||
| private $symbolsBinary; | private $symbolsBinary; | ||||
| private $haveWarnedAboutBinary; | private $haveWarnedAboutBinary; | ||||
| const LINT_PRIVATE_ACCESS = 1; | const LINT_PRIVATE_ACCESS = 1; | ||||
| const LINT_MISSING_DEPENDENCY = 2; | const LINT_MISSING_DEPENDENCY = 2; | ||||
| const LINT_UNNECESSARY_DEPENDENCY = 3; | const LINT_UNNECESSARY_DEPENDENCY = 3; | ||||
| const LINT_UNKNOWN_DEPENDENCY = 4; | const LINT_UNKNOWN_DEPENDENCY = 4; | ||||
| const LINT_MISSING_BINARY = 5; | const LINT_MISSING_BINARY = 5; | ||||
| public function getInfoName() { | |||||
| return 'Javelin Linter'; | |||||
| } | |||||
| public function getInfoDescription() { | |||||
| return pht( | |||||
| 'This linter is intended for use with the Javelin JS library and '. | |||||
| 'extensions. Use `javelinsymbols` to run Javelin rules on Javascript '. | |||||
| 'source files.'); | |||||
| } | |||||
| private function getBinaryPath() { | private function getBinaryPath() { | ||||
| if ($this->symbolsBinary === null) { | if ($this->symbolsBinary === null) { | ||||
| list($err, $stdout) = exec_manual('which javelinsymbols'); | list($err, $stdout) = exec_manual('which javelinsymbols'); | ||||
| $this->symbolsBinary = ($err ? false : rtrim($stdout)); | $this->symbolsBinary = ($err ? false : rtrim($stdout)); | ||||
| } | } | ||||
| return $this->symbolsBinary; | return $this->symbolsBinary; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 246 Lines • Show Last 20 Lines | |||||