getExecutableCommand()); $matches = array(); if (preg_match('/^(?P\d+\.\d+\.\d+)$/', $stdout, $matches)) { return $matches['version']; } else { return false; } } public function getInstallInstructions() { return pht('Install jsonlint using `npm install -g jsonlint`.'); } public function shouldExpectCommandErrors() { return true; } public function supportsReadDataFromStdin() { return true; } protected function getMandatoryFlags() { return array( '--compact', ); } protected function parseLinterOutput($path, $err, $stdout, $stderr) { $lines = phutil_split_lines($stderr, false); $messages = array(); foreach ($lines as $line) { $matches = null; $match = preg_match( '/^(?:(?.+): )?' . 'line (?\d+), col (?\d+), ' . '(?.*)$/', $line, $matches); if ($match) { $message = new ArcanistLintMessage(); $message->setPath($path); $message->setLine($matches['line']); $message->setChar($matches['column']); $message->setCode($this->getLinterName()); $message->setDescription(ucfirst($matches['description'])); $message->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR); $messages[] = $message; } } if ($err && !$messages) { return false; } return $messages; } }