ansible-community / antsibull-docs

Tooling for building Ansible documentation
https://ansible.readthedocs.io/projects/antsibull-docs/
GNU General Public License v3.0
26 stars 17 forks source link

Linter: prevent option/return value/... names which only differ by case #291

Closed felixfontein closed 2 months ago

felixfontein commented 3 months ago

For example, the cisco.dnac.discovery module has parameters:

  snmpROCommunity:
    description: SNMP RO community of the devices to be discovered.
    type: str
  snmpRoCommunity:
    description: SNMP RO community of the devices to be discovered.
    type: str

and

  snmpROCommunityDesc:
    description: Description for SNMP RO community.
    type: str
  snmpRoCommunityDesc:
    description: Description for SNMP RO community.
    type: str

These should likely be aliases of each other, instead of being separate parameters.

felixfontein commented 3 months ago

Since we have no way to disable specific linting errors, this might be better suited in ansible-test's validate-modules.

On the other hand, I can really not think of any useful case where having two options that only differ by case makes sense.

gundalow commented 3 months ago

@mattclay Any thoughts if this is a good thing for validate-modules?

mattclay commented 3 months ago

This seems like a good check to have in the validate-modules test.

felixfontein commented 3 months ago

I created a PR for this: https://github.com/ansible/ansible/pull/83530

felixfontein commented 2 months ago

Closing as this is now part of ansible-test (at least in ansible-core devel).