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]: False positive when Chinese task/play names are used #2340

Closed
brlin-tw opened this issue Aug 26, 2022 · 2 comments · Fixed by #2347
Closed

name[casing]: False positive when Chinese task/play names are used #2340

brlin-tw opened this issue Aug 26, 2022 · 2 comments · Fixed by #2347
Assignees
Labels
bug new Triage required

Comments

@brlin-tw
Copy link

brlin-tw commented Aug 26, 2022

Summary

The following error is triggered in our integration tests:

playbooks/ping.yml:6 Task/Handler: 檢查被控端是否可以連接
Issue Type
  • Bug Report
Ansible and Ansible Lint details
$ ansible --version
ansible [core 2.13.2]
  config file = /media/veracrypt1/文件/中信安科技/解決方案/自動化 Automation/Ansible 自動化配置工具/Ansible 角色範本/ansible.cfg
  configured module search path = ['/home/brlin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/brlin/.local/pipx/venvs/ansible/lib/python3.10/site-packages/ansible
  ansible collection location = __REDACTED__/playbooks/collections
  executable location = /home/brlin/.local/bin/ansible
  python version = 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0]
  jinja version = 3.1.2
  libyaml = True

$ ansible-lint --version
WARNING: PATH altered to include /home/brlin/.local/pipx/venvs/ansible/bin
ansible-lint 6.5.1 using ansible 2.13.2
  • ansible installation method: pip(pipx)
  • ansible-lint installation method: pip(pipx)
OS / ENVIRONMENT

OS: Ubuntu 22.04

STEPS TO REPRODUCE
# playbooks/ping.yml
- name: 測試範例(PoC)
  hosts: all
  tasks:
    - name: 檢查被控端是否可以連接
      ping:
Desired Behavior

When name is start with character that is not in a locale that has the casing concept, skip the rule.

Actual Behavior
$ ansible-lint playbooks/ping.yml 
WARNING: PATH altered to include /home/brlin/.local/pipx/venvs/ansible/bin
WARNING  Listing 2 violation(s) that are fatal
name: All names should start with an uppercase letter. (name[casing])
playbooks/ping.yml:2

name: All names should start with an uppercase letter. (name[casing])
playbooks/ping.yml:5 Task/Handler: 檢查被控端是否可以連接


Finished with 0 failure(s), 2 warning(s) on 1 files.

@brlin-tw brlin-tw added bug new Triage required labels Aug 26, 2022
@brlin-tw brlin-tw changed the title name[casing]: False positive when Chinese task name are used name[casing]: False positive when Chinese task/play names are used Aug 26, 2022
@ssbarnea ssbarnea self-assigned this Aug 26, 2022
@ssbarnea
Copy link
Member

For the moment you can add name[casing] to ignore list, which will disable this check. We need to decide if we want to just document this or alter the implementation to make it really trigger when first character is lowercase (as opposed to checking for uppercase presence). Probably we will include a fix in the next patch. Thanks for reporting it.

@karras
Copy link
Contributor

karras commented Aug 26, 2022

@ssbarnea I recently also stumbled into the capital letter warnings after upgrading to 6.5.x.

When checking the related PR from the COP (https://github.com/redhat-cop/automation-good-practices/pull/64/commits) I noticed that it seems the capital letter recommendation was in the end removed again:

redhat-cop/automation-good-practices@bb9df44

Thus would it make sense to disable the check by default to be aligned with the COP?

Thanks for all your work around ansible-lint!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new Triage required
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants