diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -12,6 +12,7 @@ 'ArcanistAliasWorkflow' => 'workflow/ArcanistAliasWorkflow.php', 'ArcanistAmendWorkflow' => 'workflow/ArcanistAmendWorkflow.php', 'ArcanistAnoidWorkflow' => 'workflow/ArcanistAnoidWorkflow.php', + 'ArcanistAnsibleLintLinter' => 'lint/linter/ArcanistAnsibleLintLinter.php', 'ArcanistBackoutWorkflow' => 'workflow/ArcanistBackoutWorkflow.php', 'ArcanistBaseCommitParser' => 'parser/ArcanistBaseCommitParser.php', 'ArcanistBaseCommitParserTestCase' => 'parser/__tests__/ArcanistBaseCommitParserTestCase.php', @@ -224,6 +225,7 @@ 'ArcanistAliasWorkflow' => 'ArcanistWorkflow', 'ArcanistAmendWorkflow' => 'ArcanistWorkflow', 'ArcanistAnoidWorkflow' => 'ArcanistWorkflow', + 'ArcanistAnsibleLintLinter' => 'ArcanistExternalLinter', 'ArcanistBackoutWorkflow' => 'ArcanistWorkflow', 'ArcanistBaseCommitParserTestCase' => 'ArcanistTestCase', 'ArcanistBaseUnitTestEngine' => 'ArcanistUnitTestEngine', diff --git a/src/lint/linter/ArcanistAnsibleLintLinter.php b/src/lint/linter/ArcanistAnsibleLintLinter.php new file mode 100644 --- /dev/null +++ b/src/lint/linter/ArcanistAnsibleLintLinter.php @@ -0,0 +1,99 @@ + $match) { + $matches[$key] = trim($match); + } + + /* bug in ansible-lint fixed in pull request #46: + https://github.com/willthames/ansible-lint/pull/46 + + if ($matches[3] == 0) { + continue; + } + */ + + $message = new ArcanistLintMessage(); + $message->setPath($path); + $message->setLine($matches[4]); + $message->setChar(1); + + $message->setCode($matches[1]); + $message->setName($matches[2]); + $message->setDescription($matches[3]); + // $message->setDescription("Hello"); + // $message->setSeverity($this->getLintMessageSeverity($matches[1])); + $message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING); + + $messages[] = $message; + } + + if ($err && !$messages) { + return false; + } + + return $messages; + } +}