mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-29 02:02:40 +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:
parent
2c3268f03e
commit
f17b1fa1c4
2 changed files with 35 additions and 2 deletions
|
@ -5,12 +5,14 @@
|
||||||
*/
|
*/
|
||||||
final class ArcanistPuppetLintLinter extends ArcanistExternalLinter {
|
final class ArcanistPuppetLintLinter extends ArcanistExternalLinter {
|
||||||
|
|
||||||
|
private $config;
|
||||||
|
|
||||||
public function getInfoURI() {
|
public function getInfoURI() {
|
||||||
return 'http://puppet-lint.com/';
|
return 'http://puppet-lint.com/';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getInfoName() {
|
public function getInfoName() {
|
||||||
return pht('puppet-lint');
|
return 'puppet-lint';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getInfoDescription() {
|
public function getInfoDescription() {
|
||||||
|
@ -64,6 +66,37 @@ final class ArcanistPuppetLintLinter extends ArcanistExternalLinter {
|
||||||
'%{message}'))));
|
'%{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) {
|
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
|
||||||
$lines = phutil_split_lines($stdout, false);
|
$lines = phutil_split_lines($stdout, false);
|
||||||
|
|
||||||
|
|
|
@ -3,4 +3,4 @@ exec { 'test':
|
||||||
refreshonly => true,
|
refreshonly => true,
|
||||||
}
|
}
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
warning:3:15
|
warning:2:13
|
||||||
|
|
Loading…
Reference in a new issue