This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/test/command_callback/test_ansible_lint_command_callback.vader
serapas 038e4a8c31
Fix ansible-lint linter definition. (#3601)
* 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
2021-02-28 21:43:23 +09:00

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'