1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00

Update puppet-lint linter

Summary: Update the `puppet-lint` linter to support the latest version (v1.0.1). This version allows a custom configuration file to be passed via `--config`, which brings this linter into line with other linters.

Test Plan: Update test cases to pass.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10384
This commit is contained in:
Joshua Spence 2014-08-30 00:37:01 +10:00
parent 2c3268f03e
commit f17b1fa1c4
2 changed files with 35 additions and 2 deletions

View file

@ -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);

View file

@ -3,4 +3,4 @@ exec { 'test':
refreshonly => true,
}
~~~~~~~~~~
warning:3:15
warning:2:13