ansible-test - Removed no-dict-* sanity tests

pull/82122/head
Matt Clay 1 year ago
parent 9765bb46f9
commit c349b91af3

@ -0,0 +1,3 @@
minor_changes:
- ansible-test - Removed the ``no-dict-iteritems``, ``no-dict-iterkeys`` and ``no-dict-itervalues`` sanity tests.
The tests are no longer necessary since Python 3 is required.

@ -1,7 +0,0 @@
{
"extensions": [
".py"
],
"ignore_self": true,
"output": "path-line-column-message"
}

@ -1,21 +0,0 @@
"""Disallow use of the dict.iteritems function."""
from __future__ import annotations
import re
import sys
def main():
"""Main entry point."""
for path in sys.argv[1:] or sys.stdin.read().splitlines():
with open(path, 'r', encoding='utf-8') as path_fd:
for line, text in enumerate(path_fd.readlines()):
match = re.search(r'(?<! six)\.(iteritems)', text)
if match:
print('%s:%d:%d: use `dict.items` or `ansible.module_utils.six.iteritems` instead of `dict.iteritems`' % (
path, line + 1, match.start(1) + 1))
if __name__ == '__main__':
main()

@ -1,7 +0,0 @@
{
"extensions": [
".py"
],
"ignore_self": true,
"output": "path-line-column-message"
}

@ -1,21 +0,0 @@
"""Disallow use of the dict.iterkeys function."""
from __future__ import annotations
import re
import sys
def main():
"""Main entry point."""
for path in sys.argv[1:] or sys.stdin.read().splitlines():
with open(path, 'r', encoding='utf-8') as path_fd:
for line, text in enumerate(path_fd.readlines()):
match = re.search(r'\.(iterkeys)', text)
if match:
print('%s:%d:%d: use `dict.keys` or `for key in dict:` instead of `dict.iterkeys`' % (
path, line + 1, match.start(1) + 1))
if __name__ == '__main__':
main()

@ -1,7 +0,0 @@
{
"extensions": [
".py"
],
"ignore_self": true,
"output": "path-line-column-message"
}

@ -1,21 +0,0 @@
"""Disallow use of the dict.itervalues function."""
from __future__ import annotations
import re
import sys
def main():
"""Main entry point."""
for path in sys.argv[1:] or sys.stdin.read().splitlines():
with open(path, 'r', encoding='utf-8') as path_fd:
for line, text in enumerate(path_fd.readlines()):
match = re.search(r'(?<! six)\.(itervalues)', text)
if match:
print('%s:%d:%d: use `dict.values` or `ansible.module_utils.six.itervalues` instead of `dict.itervalues`' % (
path, line + 1, match.start(1) + 1))
if __name__ == '__main__':
main()

@ -74,9 +74,6 @@ lib/ansible/module_utils/powershell/Ansible.ModuleUtils.LinkUtil.psm1 pslint:PSU
lib/ansible/module_utils/pycompat24.py no-get-exception lib/ansible/module_utils/pycompat24.py no-get-exception
lib/ansible/module_utils/six/__init__.py empty-init # breaks namespacing, bundled, do not override lib/ansible/module_utils/six/__init__.py empty-init # breaks namespacing, bundled, do not override
lib/ansible/module_utils/six/__init__.py no-basestring lib/ansible/module_utils/six/__init__.py no-basestring
lib/ansible/module_utils/six/__init__.py no-dict-iteritems
lib/ansible/module_utils/six/__init__.py no-dict-iterkeys
lib/ansible/module_utils/six/__init__.py no-dict-itervalues
lib/ansible/module_utils/six/__init__.py pylint:self-assigning-variable lib/ansible/module_utils/six/__init__.py pylint:self-assigning-variable
lib/ansible/module_utils/six/__init__.py pylint:trailing-comma-tuple lib/ansible/module_utils/six/__init__.py pylint:trailing-comma-tuple
lib/ansible/module_utils/six/__init__.py replace-urlopen lib/ansible/module_utils/six/__init__.py replace-urlopen

Loading…
Cancel
Save