Why is ansible-lint so slow? #1256
-
As I seen more than once this question being raised in various groups, I think it does deserve a clear explanation. There is no single reason, some of them are fixable but some of them will always make it be a less than instant linter. Ansible-lint does just performs a simple formatting verification of the YAML files involves, it does use ansible itself to validate that the code will not choke when run.
Why I cannot run ansible-lint only on modified files?Validation of any particular Ansible file can be affected by changes made to other files. Less than half of the problems identifiable by the linter can be process by looking at an isolated file. Due to this there is no such thing as a partial run. Yes, obviously that you can still run it on a single playbook but we do not recommend it. How slow is really ansible-lint?Based on my testing, the longest runtime was around 1m 20s on a big repository like zuul-roles, which had >330 files. To me that is fast-enough to always run it locally before uploading a change and wait for the CI/CD results. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Considering it fixed in master, the speed is quite good. |
Beta Was this translation helpful? Give feedback.
Considering it fixed in master, the speed is quite good.