diff --git a/src/lint/linter/ArcanistPuppetLintLinter.php b/src/lint/linter/ArcanistPuppetLintLinter.php index 5fc20705..230ce540 100644 --- a/src/lint/linter/ArcanistPuppetLintLinter.php +++ b/src/lint/linter/ArcanistPuppetLintLinter.php @@ -5,12 +5,14 @@ */ final class ArcanistPuppetLintLinter extends ArcanistExternalLinter { + private $config; + public function getInfoURI() { return 'http://puppet-lint.com/'; } public function getInfoName() { - return pht('puppet-lint'); + return 'puppet-lint'; } public function getInfoDescription() { @@ -64,6 +66,37 @@ final class ArcanistPuppetLintLinter extends ArcanistExternalLinter { '%{message}')))); } + public function getLinterConfigurationOptions() { + $options = array( + 'puppet-lint.config' => array( + 'type' => 'optional string', + 'help' => pht('Pass in a custom configuration file path.'), + ), + ); + + return $options + parent::getLinterConfigurationOptions(); + } + + public function setLinterConfigurationValue($key, $value) { + switch ($key) { + case 'puppet-lint.config': + $this->config = $value; + return; + } + + return parent::setLinterConfigurationValue($key, $value); + } + + protected function getDefaultFlags() { + $options = array(); + + if ($this->config) { + $options[] = '--config='.$this->config; + } + + return $options; + } + protected function parseLinterOutput($path, $err, $stdout, $stderr) { $lines = phutil_split_lines($stdout, false); diff --git a/src/lint/linter/__tests__/puppet-lint/arrow_alignment.lint-test b/src/lint/linter/__tests__/puppet-lint/arrow_alignment.lint-test index 017d6e26..78a5bf9b 100644 --- a/src/lint/linter/__tests__/puppet-lint/arrow_alignment.lint-test +++ b/src/lint/linter/__tests__/puppet-lint/arrow_alignment.lint-test @@ -3,4 +3,4 @@ exec { 'test': refreshonly => true, } ~~~~~~~~~~ -warning:3:15 +warning:2:13