Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistLinter.php
Show First 20 Lines • Show All 572 Lines • ▼ Show 20 Lines | switch ($key) { | ||||
case 'standard': | case 'standard': | ||||
$standards = (array)$value; | $standards = (array)$value; | ||||
foreach ($standards as $standard_name) { | foreach ($standards as $standard_name) { | ||||
$standard = ArcanistLinterStandard::getStandard( | $standard = ArcanistLinterStandard::getStandard( | ||||
$standard_name, | $standard_name, | ||||
$this); | $this); | ||||
$this->applyStandard($standard); | |||||
foreach ($standard->getLinterConfiguration() as $k => $v) { | |||||
$this->setLinterConfigurationValue($k, $v); | |||||
} | |||||
$this->addCustomSeverityMap($standard->getLinterSeverityMap()); | |||||
} | } | ||||
return; | return; | ||||
} | } | ||||
throw new Exception(pht('Incomplete implementation: %s!', $key)); | throw new Exception(pht('Incomplete implementation: %s!', $key)); | ||||
} | } | ||||
public function applyStandard(ArcanistLinterStandard $standard) { | |||||
foreach ($standard->getLinterConfiguration() as $k => $v) { | |||||
$this->setLinterConfigurationValue($k, $v); | |||||
} | |||||
$this->addCustomSeverityMap($standard->getLinterSeverityMap()); | |||||
} | |||||
protected function canCustomizeLintSeverities() { | protected function canCustomizeLintSeverities() { | ||||
return true; | return true; | ||||
} | } | ||||
protected function shouldLintBinaryFiles() { | protected function shouldLintBinaryFiles() { | ||||
return false; | return false; | ||||
} | } | ||||
Show All 27 Lines |