yaegassy / coc-ansible

ansible-language-server extension for coc.nvim
https://www.npmjs.com/package/@yaegassy/coc-ansible
MIT License
71 stars 3 forks source link

Question: how to pass the current file as argument to ansible-lint? #23

Closed nbn22385 closed 2 years ago

nbn22385 commented 2 years ago

When i save a file, I would like ansible-lint to only scan the current file I have open in the editor.

It seems like I would need to supply an argument to ansible.ansibleLint.arguments, but I don't know how to accomplish this in my coc-settings.json file. Any ideas?

yaegassy commented 2 years ago

The ansible-lint executed when saving a file is internally executed with the following arguments. I believe only the current file is already running by default.

ansible-lint  --offline --nocolor -f codeclimate "/PATH/TO/ANSIBLEPROJECT/roles/xxx/tasks/main.yml"

Does it run at the workspace level (project level) in your environment? Please let me know how to reproduce this as I cannot reproduce it in my environment.

nbn22385 commented 2 years ago

Ok you may be right. It seemed like it was running a little slow for me and I assumed the default value of "" for the arguments mean the same as running ansible-lint with no arguments on the command line. How can i show debug output for what command is running?

yaegassy commented 2 years ago

There does not seem to be any debugging configuration for ansible-lint provided by ansible-language-server.

It is possible to intentionally generate an error and see the command executed.

coc-ansible-issue-23-1