Programing languages have compilers or runtimes that can catch logical errors, which syntax highlights in a text editor can't predict. Markup languages might not have such tools like compilers. But a linter is a code analysis tool to spot programming and stylistic errors and to flag not optimal constructs. ansible-lint
is a linter designed specifically for ansible.
ansible-lint
checks ansible playbooks for practices and behaviour that can be improved. It combines writing ansible playbooks and testing in one application. It helps and trains to write clean playbooks. Ansible-lint is saving your time from execution errors and countless hours of debugging.