From 117cf0a44b082c604e0781dc35d251ed1626e3a9 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Tue, 14 Feb 2023 12:39:04 -0800 Subject: [PATCH] ansible-test - Disable the pep8 E203 rule (#79966) The `E203` rule in `pycodestyle` is not fully PEP 8 compliant. Disabling it provides compatibility with the output of the `black` code formatter. --- changelogs/fragments/ansible-test-pep8-e203.yml | 3 +++ .../_util/controller/sanity/pep8/current-ignore.txt | 5 +++++ test/sanity/ignore.txt | 1 - 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/ansible-test-pep8-e203.yml diff --git a/changelogs/fragments/ansible-test-pep8-e203.yml b/changelogs/fragments/ansible-test-pep8-e203.yml new file mode 100644 index 00000000000..9cba17b1107 --- /dev/null +++ b/changelogs/fragments/ansible-test-pep8-e203.yml @@ -0,0 +1,3 @@ +minor_changes: + - ansible-test - The ``pep8`` sanity test rule ``E203`` is now disabled since it is not PEP 8 compliant. + This provides compatibility with output generated by the ``black`` code formatter. diff --git a/test/lib/ansible_test/_util/controller/sanity/pep8/current-ignore.txt b/test/lib/ansible_test/_util/controller/sanity/pep8/current-ignore.txt index 659c7f59e76..4d1de69240f 100644 --- a/test/lib/ansible_test/_util/controller/sanity/pep8/current-ignore.txt +++ b/test/lib/ansible_test/_util/controller/sanity/pep8/current-ignore.txt @@ -2,3 +2,8 @@ E402 W503 W504 E741 + +# The E203 rule is not PEP 8 compliant. +# Unfortunately this means it also conflicts with the output from `black`. +# See: https://github.com/PyCQA/pycodestyle/issues/373 +E203 diff --git a/test/sanity/ignore.txt b/test/sanity/ignore.txt index fddae007e3a..577e59d0c8b 100644 --- a/test/sanity/ignore.txt +++ b/test/sanity/ignore.txt @@ -195,7 +195,6 @@ test/support/integration/plugins/module_utils/network/common/utils.py pylint:use test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/netconf/netconf.py pylint:used-before-assignment test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/filter/network.py pylint:consider-using-dict-comprehension test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/module_utils/compat/ipaddress.py no-unicode-literals -test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/module_utils/compat/ipaddress.py pep8:E203 test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/facts/facts.py pylint:unnecessary-comprehension test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/utils.py pylint:use-a-generator test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/netconf/default.py pylint:unnecessary-comprehension