038e4a8c31
* Fix ansible-lint linter definition. Use ansible-lint's feature auto-detection instead of temporary file. For auto-detection to work, ansible project has to be also a git repository. Don't use yaml rules. These are checked by yamllint. Refactor pattern to work with ansible-lint >=5.0 version. Clean-up obsolete test cases. * Pull Request changes
22 lines
879 B
Text
22 lines
879 B
Text
Before:
|
|
call ale#assert#SetUpLinterTest('ansible', 'ansible_lint')
|
|
let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
|
|
|
|
After:
|
|
unlet! b:bin_dir
|
|
unlet! b:executable
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
Execute(The ansible_lint version <5.0.0 command callback should return default string):
|
|
GivenCommandOutput ['v4.1.2']
|
|
AssertLinter 'ansible-lint', ale#Escape('ansible-lint') . ' -p %t'
|
|
|
|
Execute(The ansible_lint version >=5.0.0 command callback should return default string):
|
|
GivenCommandOutput ['v5.1.2']
|
|
AssertLinter 'ansible-lint', ale#Escape('ansible-lint') . ' --parseable-severity -x yaml'
|
|
|
|
Execute(The ansible_lint executable should be configurable):
|
|
let g:ale_ansible_ansible_lint_executable = '~/.local/bin/ansible-lint'
|
|
GivenCommandOutput ['v4.1.2']
|
|
AssertLinter '~/.local/bin/ansible-lint',
|
|
\ ale#Escape('~/.local/bin/ansible-lint') . ' -p %t'
|