From 9765bb46f9e6fd6cab1d3c9e389d3603fffea3b4 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 2 Nov 2023 11:13:41 -0700 Subject: ansible-test - Remove no-unicode-literals test --- .../ansible-test-sanity-unicode-literals.yml | 3 +++ .../sanity/code-smell/no-unicode-literals.json | 7 ------- .../sanity/code-smell/no-unicode-literals.py | 21 --------------------- 3 files changed, 3 insertions(+), 28 deletions(-) create mode 100644 changelogs/fragments/ansible-test-sanity-unicode-literals.yml delete mode 100644 test/lib/ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.json delete mode 100644 test/lib/ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.py diff --git a/changelogs/fragments/ansible-test-sanity-unicode-literals.yml b/changelogs/fragments/ansible-test-sanity-unicode-literals.yml new file mode 100644 index 0000000000..7a41660bd1 --- /dev/null +++ b/changelogs/fragments/ansible-test-sanity-unicode-literals.yml @@ -0,0 +1,3 @@ +minor_changes: + - ansible-test - Removed the ``no-unicode-literals`` sanity test. + The test is unnecessary now that Python 3 is required and the ``unicode_literals`` feature has no effect. diff --git a/test/lib/ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.json b/test/lib/ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.json deleted file mode 100644 index 88858aeb61..0000000000 --- a/test/lib/ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extensions": [ - ".py" - ], - "ignore_self": true, - "output": "path-line-column-message" -} diff --git a/test/lib/ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.py b/test/lib/ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.py deleted file mode 100644 index 75c34f2442..0000000000 --- a/test/lib/ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Disallow use of the unicode_literals future.""" -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'(unicode_literals)', text) - - if match: - print('%s:%d:%d: do not use `unicode_literals`' % ( - path, line + 1, match.start(1) + 1)) - - -if __name__ == '__main__': - main() -- cgit v1.2.3