summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ale_linters/ansible/ansible_lint.vim2
-rw-r--r--test/handler/test_ansible_lint_handler.vader6
2 files changed, 7 insertions, 1 deletions
diff --git a/ale_linters/ansible/ansible_lint.vim b/ale_linters/ansible/ansible_lint.vim
index d5d98bc4..bdfbee3c 100644
--- a/ale_linters/ansible/ansible_lint.vim
+++ b/ale_linters/ansible/ansible_lint.vim
@@ -25,7 +25,7 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
if '>=6.0.0' is# l:version_group
let l:error_codes = { 'blocker': 'E', 'critical': 'E', 'major': 'W', 'minor': 'W', 'info': 'I' }
- let l:linter_issues = json_decode(join(a:lines, ''))
+ let l:linter_issues = ale#util#FuzzyJSONDecode(a:lines, [])
for l:issue in l:linter_issues
if ale#path#IsBufferPath(a:buffer, l:issue.location.path)
diff --git a/test/handler/test_ansible_lint_handler.vader b/test/handler/test_ansible_lint_handler.vader
index e1a2ccbb..fbc38f30 100644
--- a/test/handler/test_ansible_lint_handler.vader
+++ b/test/handler/test_ansible_lint_handler.vader
@@ -93,3 +93,9 @@ Execute (The ansible-lint handler should ignore errors from other files):
\ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [5, 1, 2], [
\ '/foo/bar/roles/test_playbook.yml:6: [command-instead-of-module] [VERY_LOW] curl used in place of get_url or uri module',
\ ])
+
+Execute (The ansible-lint handler should work with empty input):
+ AssertEqual
+ \ [
+ \ ],
+ \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [6, 0, 0], [])