Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 3674 - Add nocolor option to ansible-lint #3811

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ale_linters/ansible/ansible_lint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ 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 -p %t'
\ '>=5.0.0': '%e --nocolor --parseable-severity -x yaml -',
\ '<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']

Expand Down
6 changes: 3 additions & 3 deletions test/linter/test_ansible_lint.vader
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ After:

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'
AssertLinter 'ansible-lint', ale#Escape('ansible-lint') . ' --nocolor -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 -'
AssertLinter 'ansible-lint', ale#Escape('ansible-lint') . ' --nocolor --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'
\ ale#Escape('~/.local/bin/ansible-lint') . ' --nocolor -p %t'