diff options
author | w0rp <devw0rp@gmail.com> | 2017-11-19 12:46:06 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-11-19 12:46:06 +0000 |
commit | b16c82f2f19aa7b1f1472e6d3cd2908708b56a00 (patch) | |
tree | 11e5bc836241d4091c0a0e969965a6737fb4071a /ale_linters/yaml | |
parent | d7a60ade77a30d4eed517030a0c50a5eee059be0 (diff) | |
download | ale-b16c82f2f19aa7b1f1472e6d3cd2908708b56a00.zip |
#852 - Capture error codes for swaglint
Diffstat (limited to 'ale_linters/yaml')
-rw-r--r-- | ale_linters/yaml/swaglint.vim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ale_linters/yaml/swaglint.vim b/ale_linters/yaml/swaglint.vim index 454cad05..75a496c5 100644 --- a/ale_linters/yaml/swaglint.vim +++ b/ale_linters/yaml/swaglint.vim @@ -27,6 +27,14 @@ function! ale_linters#yaml#swaglint#Handle(buffer, lines) abort \ 'text': l:match[4], \} + " Parse the code if it's there. + let l:code_match = matchlist(l:obj.text, '\v^(.+) \(([^ (]+)\)$') + + if !empty(l:code_match) + let l:obj.text = l:code_match[1] + let l:obj.code = l:code_match[2] + endif + call add(l:output, l:obj) endfor |