Changeset View
Changeset View
Standalone View
Standalone View
arcanist/linter/ClangFormatLinter.php
Show All 20 Lines | public function getLinterName() { | ||||
return 'clang-format'; | return 'clang-format'; | ||||
} | } | ||||
public function getLinterConfigurationName() { | public function getLinterConfigurationName() { | ||||
return 'clang-format'; | return 'clang-format'; | ||||
} | } | ||||
public function getLinterConfigurationOptions() { | public function getLinterConfigurationOptions() { | ||||
$options = array( | $options = array(); | ||||
); | |||||
return $options + parent::getLinterConfigurationOptions(); | return $options + parent::getLinterConfigurationOptions(); | ||||
} | } | ||||
public function getDefaultBinary() { | public function getDefaultBinary() { | ||||
return 'clang-format'; | return 'clang-format'; | ||||
} | } | ||||
public function getVersion() { | public function getVersion() { | ||||
Show All 12 Lines | public function getInstallInstructions() { | ||||
return pht('Make sure clang-format is in directory specified by $PATH'); | return pht('Make sure clang-format is in directory specified by $PATH'); | ||||
} | } | ||||
public function shouldExpectCommandErrors() { | public function shouldExpectCommandErrors() { | ||||
return false; | return false; | ||||
} | } | ||||
protected function getMandatoryFlags() { | protected function getMandatoryFlags() { | ||||
return array( | return array(); | ||||
); | |||||
} | } | ||||
protected function parseLinterOutput($path, $err, $stdout, $stderr) { | protected function parseLinterOutput($path, $err, $stdout, $stderr) { | ||||
$ok = ($err == 0); | $ok = ($err == 0); | ||||
if (!$ok) { | if (!$ok) { | ||||
return false; | return false; | ||||
} | } | ||||
Show All 11 Lines | $message = id(new ArcanistLintMessage()) | ||||
->setChar(1) | ->setChar(1) | ||||
->setGranularity(ArcanistLinter::GRANULARITY_FILE) | ->setGranularity(ArcanistLinter::GRANULARITY_FILE) | ||||
->setCode('CFMT') | ->setCode('CFMT') | ||||
->setSeverity(ArcanistLintSeverity::SEVERITY_AUTOFIX) | ->setSeverity(ArcanistLintSeverity::SEVERITY_AUTOFIX) | ||||
->setName('Code style violation') | ->setName('Code style violation') | ||||
->setDescription("'$path' has code style errors.") | ->setDescription("'$path' has code style errors.") | ||||
->setOriginalText($orig) | ->setOriginalText($orig) | ||||
->setReplacementText($stdout); | ->setReplacementText($stdout); | ||||
return array($message); | return array($message); | ||||
} | } | ||||
} | } |