Open mcico opened 3 years ago
Hello,
This is something I'm aware of and unfortunately I have not found a way yet to prevent this. The reason is that it is hard to guess if a file needs to be analyzed or not: is it a playbook? Is it a role? Is this role called from a playbook that is going to be analyzed? If not it needs to be analyzed on its own... The simplest approach I've found without going into the details of includes, playbooks and so on is to analyze all files.
If you can figure out a way to simplify this I'll be happy to have your input.
Regards,
Sylvain
I understand. I will have a look to get a better understanding and if I come up with an idea I will let you know.
Hello
I fall into this issue because we have very large inventories/playbooks repositories (>1000 files) and therefore our analysis are quite long (>1 hour).
When I run Ansible lint CLI in a local environment, each files are analysed regarding of their types (i.e playbook are not analysed as simple "YAML files").
I didn't try on too specific stuff (like roles or collections) but it seems that the ansible-lint CLI is clever enough to guess the type of each file.
Moreover, if you use Ansible lint configuration files, you have the kind anchor where you can define some specific file type you'd have to analyse.
@sbaudoin May be if you could give us an example of analysis that would fail without the "analyse each file", we could start looking for something more "clever" ?
N.B: Apart of this corner case, your plugin is great ! :)
Hey,
We started to use ansible-lint in combination with sonar. When we activate the sonar plugin (by picking the quality profile containing the ansible rules) the sonar execution takes a lot more time.
My understanding is that the sonar plugin runs ansible-lint for every file that is given as input and therefore starts a lot of ansible-lint processes. When running ansible-lint on the command line it checks all the files at once.
If my understanding is correct, would there be a way to run ansible-lint just once instead of multiple times? Here is an excerpt of an execution log
In this particular case ansible-lint is started twice, once for the playbook and once for the main.yml file in the demo role. For small projects this is no big deal, but for projects with many files the execution time increases dramatically.
cheers & thanks, marco