getProjectRoot()); } public function shouldUseInterpreter() { return true; } public function getDefaultInterpreter() { return "python3"; } public function getInstallInstructions() { return pht('The test/lint/lint-format-strings.py script is part of the '. 'bitcoin-abc project'); } public function shouldExpectCommandErrors() { return false; } protected function getMandatoryFlags() { return array(); } protected function getPathArgumentForLinterFuture($path) { // The path is expected to be relative to the project root return csprintf('%s', Filesystem::readablePath($path, $this->getProjectRoot())); } protected function parseLinterOutput($path, $err, $stdout, $stderr) { $pattern = '/^(?P.+): (?P.+): (?P.+)$/m'; $messages = array(); if (preg_match_all($pattern, $stdout, $matches, PREG_SET_ORDER)) { foreach($matches as $match) { $messages[] = id(new ArcanistLintMessage()) ->setPath($path) ->setGranularity(ArcanistLinter::GRANULARITY_FILE) ->setCode('STRFMT') ->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR) ->setName('String formatting function arguments mismatch') ->setDescription($match["code"]."\n".$match["message"]); } } return $messages; } }