Respect ale_warn_about_trailing_whitespace for yamllint

This commit is contained in:
w0rp
2018-07-01 13:49:40 +01:00
parent e5e14de9ae
commit 06f61eeeb8
2 changed files with 39 additions and 1 deletions

View File

@@ -34,6 +34,12 @@ function! ale_linters#yaml#yamllint#Handle(buffer, lines) abort
let l:code_match = matchlist(l:item.text, '\v^(.+) \(([^)]+)\)$')
if !empty(l:code_match)
if l:code_match[2] is# 'trailing-spaces'
\&& !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
" Skip warnings for trailing whitespace if the option is off.
continue
endif
let l:item.text = l:code_match[1]
let l:item.code = l:code_match[2]
endif