Skip to content

Commit

Permalink
ruff changes compatible with black
Browse files Browse the repository at this point in the history
Signed-off-by: Alina Buzachis <[email protected]>
  • Loading branch information
alinabuzachis committed Apr 24, 2024
1 parent 599d7ab commit b7f00f0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
1 change: 0 additions & 1 deletion plugins/module_utils/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class AWSErrorHandler:

"""_CUSTOM_EXCEPTION can be overridden by subclasses to customize the exception raised"""

_CUSTOM_EXCEPTION = AnsibleAWSError
Expand Down
24 changes: 16 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -60,23 +68,23 @@ 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`
"N806", # Variable in function should be lowercase
"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`).
Expand Down Expand Up @@ -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"
docstring-code-line-length = "dynamic"
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
(but without needing the OpenSSL CLI)
"""


import hashlib
import sys

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/utils/amazon_placebo_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_", "")

Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit b7f00f0

Please sign in to comment.