Use ruff format, and then undo most changes with black and isort. (#903)

This commit is contained in:
Felix Fontein
2025-05-24 08:30:31 +02:00
committed by GitHub
parent f3db4eeea5
commit b8adc3b241
34 changed files with 23 additions and 63 deletions

View File

@@ -52,7 +52,6 @@ if t.TYPE_CHECKING:
class KeypairBackend(OpensshModule, metaclass=abc.ABCMeta):
def __init__(self, *, module: AnsibleModule) -> None:
super().__init__(module=module)
@@ -567,8 +566,7 @@ def select_backend(
else:
module.fail_json(
msg=(
"Cannot find either the OpenSSH binary in the PATH "
f"or cryptography >= {COLLECTION_MINIMUM_CRYPTOGRAPHY_VERSION} installed on this system"
f"Cannot find either the OpenSSH binary in the PATH or cryptography >= {COLLECTION_MINIMUM_CRYPTOGRAPHY_VERSION} installed on this system"
)
)

View File

@@ -779,8 +779,7 @@ def get_option_type(name: str) -> t.Literal["critical", "extension"]:
if name in _EXTENSIONS:
return "extension"
raise ValueError(
f"{name} is not a valid option. "
"Custom options must start with 'critical:' or 'extension:' to indicate type"
f"{name} is not a valid option. Custom options must start with 'critical:' or 'extension:' to indicate type"
)

View File

@@ -370,7 +370,8 @@ class AsymmetricKeypair:
try:
return self.__privatekey.sign(
data, **_ALGORITHM_PARAMETERS[self.__keytype]["signer_params"] # type: ignore
data,
**_ALGORITHM_PARAMETERS[self.__keytype]["signer_params"], # type: ignore
)
except TypeError as e:
raise InvalidDataError(e) from e
@@ -788,7 +789,6 @@ def validate_comment(comment: str) -> None:
def extract_comment(path: str | os.PathLike) -> str:
if not os.path.exists(path):
raise InvalidPublicKeyFileError(f"No file was found at {path}")