Summary
When changing "shell:" to "ansible.builtin.command:" when using --fix it removes all code comments in the shell but also any code comments that are not even part of the shell but above the next "- name"
Issue Type
OS / ENVIRONMENT
STEPS TO REPRODUCE
- name: foo
shell: "whatever"
# a comment
- name: bar
shell: |
something
# shell: "foobar"
register: hello
Run ansible-lint --fix --profile production
Results in:
- name: Foo
ansible.builtin.command: "whatever"
- name: Bar
ansible.builtin.command: |
something
register: hello
Desired Behavior
Don't remove code comments for and after shell
Actual Behavior
Removes code comments in and after shell