diff --git a/plugins/module_utils/errors.py b/plugins/module_utils/errors.py index 38e9b380072..17bc6ed1e36 100644 --- a/plugins/module_utils/errors.py +++ b/plugins/module_utils/errors.py @@ -14,7 +14,6 @@ class AWSErrorHandler: - """_CUSTOM_EXCEPTION can be overridden by subclasses to customize the exception raised""" _CUSTOM_EXCEPTION = AnsibleAWSError diff --git a/pyproject.toml b/pyproject.toml index ee0d09c26ab..36287265650 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,20 @@ [tool.black] skip-string-normalization = false line-length = 120 -target-version = [ "py37", "py38",] -extend-exclude = "/(\n | plugins/module_utils/_version.py\n)/\n" +target-version = ['py37', 'py38'] +extend-exclude = ''' +/( + | plugins/module_utils/_version.py +)/ +''' [tool.darker] revision = "origin/main.." -src = [ "plugins", "tests/unit", "tests/integration",] +src = [ + "plugins", + "tests/unit", + "tests/integration", +] [tool.isort] profile = "black" @@ -60,15 +68,15 @@ select = [ ignore = [ # Conflicts with the formatter "COM812", "ISC001", - "E741", # Ambiguous variable name + "E741", # Ambiguous variable name "E501", # Never enforce `E501` (line length violations). "F401", # imported but unused "F811", # redefinition of unnused "F841", # Local variable is assigned to but never used "PLR", # Design related pylint codes "PLW", # Design related pylint codes - "D202", # No blank lines allowed after function docstring (found 1) - "D205", # 1 blank line required between summary line and description + "D202", # No blank lines allowed after function docstring (found 1) + "D205", # 1 blank line required between summary line and description "D401", # First line of docstring should be in imperative mood "D403", # First word of the first line should be capitalized "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` @@ -76,7 +84,7 @@ ignore = [ "N802", # Function name should be lowercase "N818", # Exception name should be named with an Error suffix "N803", # Argument name `keyId` should be lowercase - "N801", # Class name should use CapWords convention + "N801", # Class name should use CapWords convention ] # Disable fix for unused imports (`F401`). @@ -138,4 +146,4 @@ docstring-code-format = false # # This only has an effect when the `docstring-code-format` setting is # enabled. -docstring-code-line-length = "dynamic" \ No newline at end of file +docstring-code-line-length = "dynamic" diff --git a/tests/integration/targets/setup_sshkey/files/ec2-fingerprint.py b/tests/integration/targets/setup_sshkey/files/ec2-fingerprint.py index 04d2eb1ea54..88ff4be3601 100644 --- a/tests/integration/targets/setup_sshkey/files/ec2-fingerprint.py +++ b/tests/integration/targets/setup_sshkey/files/ec2-fingerprint.py @@ -8,7 +8,6 @@ (but without needing the OpenSSL CLI) """ - import hashlib import sys diff --git a/tests/unit/utils/amazon_placebo_fixtures.py b/tests/unit/utils/amazon_placebo_fixtures.py index afe91adad43..6af542726ef 100644 --- a/tests/unit/utils/amazon_placebo_fixtures.py +++ b/tests/unit/utils/amazon_placebo_fixtures.py @@ -64,7 +64,7 @@ def placeboify(request, monkeypatch): request.fspath.dirname, "placebo_recordings", request.fspath.basename.replace(".py", ""), - request.function.__name__ + request.function.__name__, # remove the test_ prefix from the function & file name ).replace("test_", "") diff --git a/tox.ini b/tox.ini index 030ffc338bd..d2530095430 100644 --- a/tox.ini +++ b/tox.ini @@ -3,8 +3,8 @@ skipsdist = True envlist = clean,ansible{2.12,2.13}-py{38,39,310}-{with_constraints,without_constraints},linters # Tox4 supports labels which allow us to group the environments rather than dumping all commands into a single environment labels = - format = flynt, black, isort - lint = complexity-report, ansible-lint, black-lint, isort-lint, flake8-lint, flynt-lint + format = flynt, black, isort, ruff + lint = complexity-report, ansible-lint, black-lint, isort-lint, flake8-lint, flynt-lint, ruff-lint units = ansible{2.12,2.13}-py{38,39,310}-{with_constraints,without_constraints} [common]