Skip to content

Instantly share code, notes, and snippets.

@displague
Created April 23, 2021 05:19
Show Gist options
  • Save displague/9aacc3bb335c0f55650a26518770d23d to your computer and use it in GitHub Desktop.
Save displague/9aacc3bb335c0f55650a26518770d23d to your computer and use it in GitHub Desktop.

Ansible Reviewer linting

Linting per ansible-collections/ansible-inclusion#15 (reply in thread) via https://github.com/Andersson007/ansible_reviewer

git clone https://github.com/equinix/ansible-collection-metal
git clone https://github.com/Andersson007/ansible_reviewer
chmod a+x ansible_reviewer/{yasp,module_reviewer.py}
pip3 install beautifulsoup4 html5lib lxml

cd ansible-collection-metal
ln -s ../ansible_reviewer/module_reviewer.py
ln -s ../ansible_reviewer/yasp
ansible-galaxy collection build --force
ansible-galaxy collection install equinix-metal-1.4.1.tar.gz -p ./collections
find collections/ -type f -name \*py | grep -v "__" | while read LINE; do echo "======="; echo $LINE; echo "======="; python3 ./module_reviewer.py $LINE -s; done
$ find collections/ -type f -name \*py | grep -v "__" | while read LINE; do echo "======="; echo $LINE; echo "======="; python3 ./module_reviewer.py $LINE -s; done
=======
collections//ansible_collections/equinix/metal/plugins/doc_fragments/auth_options.py
=======
"DOCUMENTATION" section is not provided, nothing to parse, exit
=======
collections//ansible_collections/equinix/metal/plugins/doc_fragments/metal_project.py
=======
"DOCUMENTATION" section is not provided, nothing to parse, exit
=======
collections//ansible_collections/equinix/metal/plugins/doc_fragments/metal_project_optional.py
=======
"DOCUMENTATION" section is not provided, nothing to parse, exit
=======
collections//ansible_collections/equinix/metal/plugins/doc_fragments/metal.py
=======
"DOCUMENTATION" section is not provided, nothing to parse, exit
=======
collections//ansible_collections/equinix/metal/plugins/inventory/device.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 without using "name"
examples: #1 no FQCN
examples: #2 without using "name"
examples: #2 no FQCN
examples: #3 without using "name"
examples: #3 no FQCN
examples: #4 without using "name"
examples: #4 no FQCN
return: no RETURN section, there must be, at least, RETURN = r"""#"""
=======
collections//ansible_collections/equinix/metal/plugins/module_utils/metal.py
=======
"DOCUMENTATION" section is not provided, nothing to parse, exit
=======
collections//ansible_collections/equinix/metal/plugins/modules/device_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
return devices: line 1 does not end with a dot
=======
collections//ansible_collections/equinix/metal/plugins/modules/facility_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
return facilities: line 1 does not end with a dot
=======
collections//ansible_collections/equinix/metal/plugins/modules/plan_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
return plans: line 1 does not end with a dot
=======
collections//ansible_collections/equinix/metal/plugins/modules/ip_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
return ips: line 1 does not end with a dot
=======
collections//ansible_collections/equinix/metal/plugins/modules/device.py
=======
Cannot parse RETURN section: while scanning a simple key
in "<unicode string>", line 15, column 1:
''' # NOQA
^
could not find expected ':'
in "<unicode string>", line 33, column 6:
'queued',
^
Possible typos in EXAMPLES:
KeyError occurred: source is "xyz"
stdin : line [52] : newhosts > new hosts, new host's, news hosts
--------------------
opt count: abbreviations/latin phrases found 'via ', use 'by/through' instead
notes: abbreviations/latin phrases found 'doesn't', use 'does not' instead
examples: #1 no FQCN
examples: #2 no FQCN
examples: #3 no FQCN
examples: #4 no FQCN
examples: #5 no FQCN
=======
collections//ansible_collections/equinix/metal/plugins/modules/project_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
return projects: line 1 does not end with a dot
=======
collections//ansible_collections/equinix/metal/plugins/modules/sshkey_info.py
=======
Cannot parse RETURN section: while scanning a simple key
in "<unicode string>", line 13, column 1:
''' # noqa
^
could not find expected ':'
in "<unicode string>", line 23, column 27:
if module.params.get('ids'):
^
Possible typos in the file:
stdin: nothing to parse
--------------------
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
=======
collections//ansible_collections/equinix/metal/plugins/modules/sshkey.py
=======
Cannot parse RETURN section: while scanning a simple key
in "<unicode string>", line 18, column 1:
''' # noqa
^
could not find expected ':'
in "<unicode string>", line 28, column 15:
ret_dict['key'] = key_str
^
Possible typos in the file:
stdin: nothing to parse
--------------------
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
examples: #3 no FQCN
=======
collections//ansible_collections/equinix/metal/plugins/modules/org_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
return organizations: line 1 does not end with a dot
=======
collections//ansible_collections/equinix/metal/plugins/modules/user_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
=======
collections//ansible_collections/equinix/metal/plugins/modules/capacity_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
=======
collections//ansible_collections/equinix/metal/plugins/modules/ip_subnet.py
=======
opt hostname: explicit "require: false" declaration
opt device_id: explicit "require: false" declaration
opt state: abbreviations/latin phrases found 'it's', use 'it is' instead
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
return device_id: no sample
=======
collections//ansible_collections/equinix/metal/plugins/modules/project.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
examples: #3 no FQCN
examples: #4 no FQCN
return name: no sample
return id: no sample
=======
collections//ansible_collections/equinix/metal/plugins/modules/operating_system_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
return operating_systems: line 1 does not end with a dot
=======
collections//ansible_collections/equinix/metal/tests/unit/plugins/module_utils/conftest.py
=======
"DOCUMENTATION" section is not provided, nothing to parse, exit
=======
collections//ansible_collections/equinix/metal/tests/unit/plugins/module_utils/test_metal.py
=======
"DOCUMENTATION" section is not provided, nothing to parse, exit
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/doc_fragments/auth_options.py
=======
"DOCUMENTATION" section is not provided, nothing to parse, exit
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/doc_fragments/metal_project.py
=======
"DOCUMENTATION" section is not provided, nothing to parse, exit
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/doc_fragments/metal_project_optional.py
=======
"DOCUMENTATION" section is not provided, nothing to parse, exit
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/doc_fragments/metal.py
=======
"DOCUMENTATION" section is not provided, nothing to parse, exit
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/inventory/device.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 without using "name"
examples: #1 no FQCN
examples: #2 without using "name"
examples: #2 no FQCN
examples: #3 without using "name"
examples: #3 no FQCN
examples: #4 without using "name"
examples: #4 no FQCN
return: no RETURN section, there must be, at least, RETURN = r"""#"""
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/module_utils/metal.py
=======
"DOCUMENTATION" section is not provided, nothing to parse, exit
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/modules/device_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
return devices: line 1 does not end with a dot
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/modules/facility_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
return facilities: line 1 does not end with a dot
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/modules/plan_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
return plans: line 1 does not end with a dot
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/modules/ip_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
return ips: line 1 does not end with a dot
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/modules/device.py
=======
Cannot parse RETURN section: while scanning a simple key
in "<unicode string>", line 15, column 1:
''' # NOQA
^
could not find expected ':'
in "<unicode string>", line 33, column 6:
'queued',
^
Possible typos in EXAMPLES:
KeyError occurred: source is "xyz"
stdin : line [52] : newhosts > new hosts, new host's, news hosts
--------------------
opt count: abbreviations/latin phrases found 'via ', use 'by/through' instead
notes: abbreviations/latin phrases found 'doesn't', use 'does not' instead
examples: #1 no FQCN
examples: #2 no FQCN
examples: #3 no FQCN
examples: #4 no FQCN
examples: #5 no FQCN
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/modules/project_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
return projects: line 1 does not end with a dot
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/modules/sshkey_info.py
=======
Cannot parse RETURN section: while scanning a simple key
in "<unicode string>", line 13, column 1:
''' # noqa
^
could not find expected ':'
in "<unicode string>", line 23, column 27:
if module.params.get('ids'):
^
Possible typos in the file:
stdin: nothing to parse
--------------------
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/modules/sshkey.py
=======
Cannot parse RETURN section: while scanning a simple key
in "<unicode string>", line 18, column 1:
''' # noqa
^
could not find expected ':'
in "<unicode string>", line 28, column 15:
ret_dict['key'] = key_str
^
Possible typos in the file:
stdin: nothing to parse
--------------------
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
examples: #3 no FQCN
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/modules/org_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
return organizations: line 1 does not end with a dot
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/modules/user_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/modules/capacity_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/modules/ip_subnet.py
=======
opt hostname: explicit "require: false" declaration
opt device_id: explicit "require: false" declaration
opt state: abbreviations/latin phrases found 'it's', use 'it is' instead
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
return device_id: no sample
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/modules/project.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
examples: #3 no FQCN
examples: #4 no FQCN
return name: no sample
return id: no sample
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/plugins/modules/operating_system_info.py
=======
no "notes" section, it should, at least, contain info about check_mode support
examples: #1 no FQCN
examples: #2 no FQCN
return operating_systems: line 1 does not end with a dot
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/tests/unit/plugins/module_utils/conftest.py
=======
"DOCUMENTATION" section is not provided, nothing to parse, exit
=======
collections//ansible_collections/equinix/metal/collections/ansible_collections/equinix/metal/tests/unit/plugins/module_utils/test_metal.py
=======
"DOCUMENTATION" section is not provided, nothing to parse, exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment