generated from jCloud/repository-template
chore: lint source code using Ruff
This commit is contained in:
35 files changed
+161
-130
No files matched your search
@@ -16,11 +16,11 @@
|
||||
The utilities for jcloud_docsgen
|
||||
"""
|
||||
|
||||
import pathlib
|
||||
import os
|
||||
import errno
|
||||
from typing import Union
|
||||
import os
|
||||
import pathlib
|
||||
import types
|
||||
from typing import Union
|
||||
|
||||
try:
|
||||
from warnings import deprecated
|
||||
@@ -152,11 +152,7 @@ def _list_type_names(types: list[type]) -> list[str]:
|
||||
|
||||
def assert_that_is_instance(
|
||||
obj: object,
|
||||
class_or_tuple: Union[
|
||||
type,
|
||||
types.UnionType,
|
||||
tuple[type, ...],
|
||||
],
|
||||
class_or_tuple: type | types.UnionType | tuple[type, ...],
|
||||
) -> None:
|
||||
if not isinstance(class_or_tuple, Union[type, types.UnionType, tuple]):
|
||||
raise TypeError(
|
||||
@@ -185,7 +181,7 @@ def assert_that_is_instance(
|
||||
)
|
||||
|
||||
|
||||
def non_empty_str(value: Union[str, None]) -> Union[str, None]:
|
||||
def non_empty_str(value: str | None) -> str | None:
|
||||
"""
|
||||
Returns the value or ``None``.
|
||||
|
||||
@@ -195,10 +191,10 @@ def non_empty_str(value: Union[str, None]) -> Union[str, None]:
|
||||
of spaces, it is also considered empty.
|
||||
|
||||
:param value: The value.
|
||||
:type value: Union[str, None]
|
||||
:type value: str | None
|
||||
|
||||
:return: The value or ``None``.
|
||||
:rtype: Union[str, None]
|
||||
:rtype: str | None
|
||||
"""
|
||||
|
||||
if value is None:
|
||||
|
||||
Reference in new issue
Block a user