Add stdin ("-") to the command-line arguments of ansible-lint >=5.0.0 (#3786)

* Added an explicit stdin argument to ansible-lint >=5.0.0 (ansible_lint.vim).

This commit fixes the issue "<<NO OUTPUT RETURNED>>":
```
:ALEInfo
(finished - exit code 0) ['/bin/bash', '-c', ''ansible-lint'' --parseable-severity -x yaml < ''/tmp/vVyvn4B/7/test2.yml'']
<<<NO OUTPUT RETURNED>>>'
```

Reason: Ansible-lint ignores stdin when "-" or "/dev/stdin" is not
specified explicitly.

Tested with: ansible-lint 5.0.12 using ansible 2.11.2

* Update ansible-lint tests.
This commit is contained in:
James Cherti
2021-07-05 12:48:32 +00:00
committed by GitHub
parent 87e079a9b2
commit af13c350d2
2 changed files with 2 additions and 2 deletions

View File

@@ -73,7 +73,7 @@ endfunction
function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort
let l:commands = {
\ '>=5.0.0': '%e --parseable-severity -x yaml',
\ '>=5.0.0': '%e --parseable-severity -x yaml -',
\ '<5.0.0': '%e -p %t'
\}
let l:command = ale#semver#GTE(a:version, [5, 0]) ? l:commands['>=5.0.0'] : l:commands['<5.0.0']