Skip to content
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

name[casing] error should be raised for notify task param #4035

Closed
audgirka opened this issue Feb 19, 2024 · 2 comments · Fixed by #4149
Closed

name[casing] error should be raised for notify task param #4035

audgirka opened this issue Feb 19, 2024 · 2 comments · Fixed by #4149
Labels

Comments

@audgirka
Copy link
Contributor

When we raise a name[casing] issue for a task under handler, the same should be raised for a task which is calling this handler task using notify task parameter

Related #4028

@audgirka audgirka added new Triage required bug labels Feb 19, 2024
@audgirka audgirka changed the title name[casing] issue should be raised for "notify" field under a task name[casing] issue should be raised for "notify" field under a task Feb 19, 2024
@audgirka audgirka changed the title name[casing] issue should be raised for "notify" field under a task name[casing] issue should be raised for "notify" task param Feb 19, 2024
@audgirka audgirka changed the title name[casing] issue should be raised for "notify" task param name[casing] error should be raised for "notify" task param Feb 20, 2024
@audgirka audgirka changed the title name[casing] error should be raised for "notify" task param name[casing] error should be raised for notify task param Feb 20, 2024
@ssbarnea ssbarnea removed the new Triage required label Feb 28, 2024
@audgirka audgirka self-assigned this Mar 13, 2024
@audgirka audgirka removed their assignment May 7, 2024
cavcrosby added a commit to cavcrosby/ansible-lint that referenced this issue May 11, 2024
cavcrosby added a commit to cavcrosby/ansible-lint that referenced this issue May 11, 2024
cavcrosby added a commit to cavcrosby/ansible-lint that referenced this issue May 11, 2024
The become.yml playbook had its name[casing] violation fixed because
said playbook isn't expected to be tested for name[casing] violations.
@pneerincx
Copy link

This produces false errors for cases where a handler uses an explicit listen, which does not need to start with an uppercase character. Hence notify does not need to start with an uppercase character in that case either.

E.g. this handler:

- name: This handler name started with an uppercase character
   ansible.builtin.command:
     cmd: echo "Handler executed"
  changed_when: true
  listen: execute-my-handler

in combination with this task:

- name: This task name started with an uppercase character
   ansible.builtin.debug:
     cmd: echo "Just a dummy task to notify a handler."
  changed_when: true
  execute: execute-my-handler

will trigger

name[casing]: Task notify 'execute-my-handler' should start with an uppercase letter.

even though both task and handler names start with uppercase characters.

@gardar
Copy link

gardar commented May 16, 2024

I don't like this one.

I usually stick to simple keywords when notifying handlers which I define under listen. And the name of the handler I use as a description of the task.

Checking the casting of the handler task name should be enough, it should catch any task names. No need to do it for the listen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants