add: support project-local ansible-lint (#5015)

Add support for project-local `ansible-lint` (via `uv`, `poetry`, and `pipenv`) 
when using the system-wide installed one is not possible or not desirable.
This commit is contained in:
Yining
2025-08-13 23:19:15 +10:00
committed by GitHub
parent 206b414120
commit c74b917648
6 changed files with 127 additions and 13 deletions

View File

@@ -24,3 +24,28 @@ Execute(The ansible_lint executable should be configurable):
GivenCommandOutput ['v4.1.2']
AssertLinter '~/.local/bin/ansible-lint',
\ ale#Escape('~/.local/bin/ansible-lint') . ' --nocolor -p %t'
Execute(pipenv is detected when ansible_ansible_lint_auto_pipenv is set):
let g:ale_ansible_ansible_lint_auto_pipenv = 1
call ale#test#SetFilename('../test-files/ansible/pipenv/script.yml')
GivenCommandOutput ['v25.6.1']
AssertLinterCwd expand('%:p:h')
AssertLinter 'pipenv', ale#Escape('pipenv') . ' run ansible-lint --nocolor -f json -x yaml %s'
Execute(poetry is detected when ansible_ansible_lint_auto_poetry is set):
let g:ale_ansible_ansible_lint_auto_poetry = 1
call ale#test#SetFilename('../test-files/ansible/poetry/script.yml')
GivenCommandOutput ['v25.6.1']
AssertLinterCwd expand('%:p:h')
AssertLinter 'poetry', ale#Escape('poetry') . ' run ansible-lint --nocolor -f json -x yaml %s'
Execute(uv is detected when ansible_ansible_lint_auto_uv is set):
let g:ale_ansible_ansible_lint_auto_uv = 1
call ale#test#SetFilename('../test-files/ansible/uv/script.yml')
GivenCommandOutput ['v25.6.1']
AssertLinterCwd expand('%:p:h')
AssertLinter 'uv', ale#Escape('uv') . ' run ansible-lint --nocolor -f json -x yaml %s'

View File

View File

0
test/test-files/ansible/uv/uv.lock generated Normal file
View File