summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-11-15 10:11:32 +0000
committerw0rp <devw0rp@gmail.com>2017-11-15 10:11:32 +0000
commitff5c6b050955577322c50ffbae15f722d6d82b18 (patch)
tree56048bab7c38a370fb160ca6d82b6af0d631a6a5
parent37f2f7043945b9e3a4567e39bfdd3abce5a87f57 (diff)
downloadale-ff5c6b050955577322c50ffbae15f722d6d82b18.zip
#852 - Capture error codes for ansible-lint
-rw-r--r--ale_linters/ansible/ansible_lint.vim3
-rw-r--r--test/handler/test_ansible_lint_handler.vader6
2 files changed, 6 insertions, 3 deletions
diff --git a/ale_linters/ansible/ansible_lint.vim b/ale_linters/ansible/ansible_lint.vim
index 7d68cde3..27c96320 100644
--- a/ale_linters/ansible/ansible_lint.vim
+++ b/ale_linters/ansible/ansible_lint.vim
@@ -31,7 +31,8 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, lines) abort
call add(l:output, {
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
- \ 'text': l:code . ': ' . l:match[5],
+ \ 'text': l:match[5],
+ \ 'code': l:code,
\ 'type': l:code[:0] is# 'E' ? 'E' : 'W',
\})
endif
diff --git a/test/handler/test_ansible_lint_handler.vader b/test/handler/test_ansible_lint_handler.vader
index 3a86429c..cd6e513e 100644
--- a/test/handler/test_ansible_lint_handler.vader
+++ b/test/handler/test_ansible_lint_handler.vader
@@ -12,7 +12,8 @@ Execute(The ansible-lint handler should handle basic errors):
\ 'lnum': 35,
\ 'col': 0,
\ 'type': 'E',
- \ 'text': 'EANSIBLE0002: Trailing whitespace',
+ \ 'text': 'Trailing whitespace',
+ \ 'code': 'EANSIBLE0002',
\ },
\ ],
\ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [
@@ -26,7 +27,8 @@ Execute (The ansible-lint handler should handle names with spaces):
\ 'lnum': 6,
\ 'col': 6,
\ 'type': 'E',
- \ 'text': 'E111: indentation is not a multiple of four',
+ \ 'text': 'indentation is not a multiple of four',
+ \ 'code': 'E111',
\ },
\ ],
\ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [