mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-08 21:44:47 +08:00
Do not use tempfiles for ansible lint (#3846)
* Used %s instead of std in * Set lint_file to 1 for ansible-lint so it does not use temp files * Fix test for ansible-lint
This commit is contained in:
@@ -73,7 +73,7 @@ endfunction
|
|||||||
|
|
||||||
function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort
|
function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort
|
||||||
let l:commands = {
|
let l:commands = {
|
||||||
\ '>=5.0.0': '%e --nocolor --parseable-severity -x yaml -',
|
\ '>=5.0.0': '%e --nocolor --parseable-severity -x yaml %s',
|
||||||
\ '<5.0.0': '%e --nocolor -p %t'
|
\ '<5.0.0': '%e --nocolor -p %t'
|
||||||
\}
|
\}
|
||||||
let l:command = ale#semver#GTE(a:version, [5, 0]) ? l:commands['>=5.0.0'] : l:commands['<5.0.0']
|
let l:command = ale#semver#GTE(a:version, [5, 0]) ? l:commands['>=5.0.0'] : l:commands['<5.0.0']
|
||||||
@@ -91,6 +91,7 @@ call ale#linter#Define('ansible', {
|
|||||||
\ '%e --version',
|
\ '%e --version',
|
||||||
\ function('ale_linters#ansible#ansible_lint#GetCommand'),
|
\ function('ale_linters#ansible#ansible_lint#GetCommand'),
|
||||||
\ )},
|
\ )},
|
||||||
|
\ 'lint_file': 1,
|
||||||
\ 'callback': {buffer, lines -> ale#semver#RunWithVersionCheck(
|
\ 'callback': {buffer, lines -> ale#semver#RunWithVersionCheck(
|
||||||
\ buffer,
|
\ buffer,
|
||||||
\ ale_linters#ansible#ansible_lint#GetExecutable(buffer),
|
\ ale_linters#ansible#ansible_lint#GetExecutable(buffer),
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Execute(The ansible_lint version <5.0.0 command callback should return default s
|
|||||||
|
|
||||||
Execute(The ansible_lint version >=5.0.0 command callback should return default string):
|
Execute(The ansible_lint version >=5.0.0 command callback should return default string):
|
||||||
GivenCommandOutput ['v5.1.2']
|
GivenCommandOutput ['v5.1.2']
|
||||||
AssertLinter 'ansible-lint', ale#Escape('ansible-lint') . ' --nocolor --parseable-severity -x yaml -'
|
AssertLinter 'ansible-lint', ale#Escape('ansible-lint') . ' --nocolor --parseable-severity -x yaml %s'
|
||||||
|
|
||||||
Execute(The ansible_lint executable should be configurable):
|
Execute(The ansible_lint executable should be configurable):
|
||||||
let g:ale_ansible_ansible_lint_executable = '~/.local/bin/ansible-lint'
|
let g:ale_ansible_ansible_lint_executable = '~/.local/bin/ansible-lint'
|
||||||
|
|||||||
Reference in New Issue
Block a user