-
Notifications
You must be signed in to change notification settings - Fork 688
Rule unnamed-task should not have any exceptions #1411
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
Comments
I agree strongly, the idea that certain tasks, hidden in the code of the linter, have an exempt status is to me confusing and echo @ansiblejunky's comment A simple straightforward rule that should always be applied |
These exceptions are historical and very old and I do also agree with OP as we should have no exceptions. Please make a pull-request to remove them, I will support it. I will only need to wait a little bit more before releasing it as it will annoy few users. I do remember having long-debates with some colleagues in the past which seen the naming of the tasks useless. Some things changed and did not hear the the same comment for very long time. Personally I would even look to have a test for no-dup-task-name, as this is another common mistake around naming which makes debugging hard, as you have no idea which task produced it. |
Closes: #1411 Signed-off-by: Thomas Sjögren <[email protected]>
Because of the change in the upstream of ansible-lint below every tasks including 'meta' does not do usual 'task' and self-descriptive ones like debug and include_tasks must have name even if it is good for nothing, IMHO. - ansible/ansible-lint#1411
Because of the change in the upstream of ansible-lint below every tasks including 'meta' does not do usual 'task' and self-descriptive ones like debug and include_tasks must have name even if it is good for nothing, IMHO. - ansible/ansible-lint#1411
Summary
Ansible good practice generally states to name all your tasks. A simple straightforward rule that should always be applied. Having exceptions to this rule breaks the general philosophy around maintaining good practice. Additionally, ansible-lint docs never state the exceptions at all for this rule. However in the Python code we can see there are indeed exceptions that are not enforced.
While there can be a debate around naming these modules in the exceptions, it generally is a much better practice to have a simple rule that is always applied versus having exceptions to the rule especially when they are not truly documented anywhere.
Issue Type
Ansible and Ansible Lint details
OS / ENVIRONMENT
any
STEPS TO REPRODUCE
Run ansible-lint against playbook containing unnamed tasks using any of the module exceptions (debug, meta, etc.).
Desired Behaviour
ansible-lint should not have exceptions to this rule and should enforce naming of all tasks
Actual Behaviour
ansible-lint does not complain when unnamed tasks use the modules listed in the python code as exceptions
The text was updated successfully, but these errors were encountered: