diff --git a/arcanist/linter/ClangFormatLinter.php b/arcanist/linter/ClangFormatLinter.php index da1a8ef75..689f1a579 100644 --- a/arcanist/linter/ClangFormatLinter.php +++ b/arcanist/linter/ClangFormatLinter.php @@ -1,104 +1,104 @@ getExecutableCommand()); $matches = array(); $regex = '/^clang-format version (?P\d+\.\d+)\./'; if (preg_match($regex, $stdout, $matches)) { $version = $matches['version']; } else { return false; } /* - * FIXME: This is a hack to only allow for clang-format version 10.x. + * FIXME: This is a hack to only allow for clang-format version 11.x. * The .arclint `version` field only allow to filter versions using `=`, * `>`, `<`, `>=` or `<=`. There is no facility to define that the required * version should be >= 11.0 and < 12.0. */ if (substr($version, 0, 2) != '11') { throw new Exception(pht('Linter %s requires clang-format version 11.x. '. 'You have version %s.', ClangFormatLinter::class, $version)); } return $version; } public function getInstallInstructions() { return pht('Make sure clang-format is in directory specified by $PATH'); } public function shouldExpectCommandErrors() { return false; } protected function getMandatoryFlags() { return array(); } protected function parseLinterOutput($path, $err, $stdout, $stderr) { $ok = ($err == 0); if (!$ok) { return false; } $root = $this->getProjectRoot(); $path = Filesystem::resolvePath($path, $root); $orig = file_get_contents($path); if ($orig == $stdout) { return array(); } $message = id(new ArcanistLintMessage()) ->setPath($path) ->setLine(1) ->setChar(1) ->setGranularity(ArcanistLinter::GRANULARITY_FILE) ->setCode('CFMT') ->setSeverity(ArcanistLintSeverity::SEVERITY_AUTOFIX) ->setName('Code style violation') ->setDescription("'$path' has code style errors.") ->setOriginalText($orig) ->setReplacementText($stdout); return array($message); } }