From c42ee44fc8d1419172b9387d1dc3fa72f743728e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 20:12:54 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- rustshed/option_result.py | 68 ++++++++++++++++----------------------- rustshed/panic.py | 3 +- 2 files changed, 29 insertions(+), 42 deletions(-) diff --git a/rustshed/option_result.py b/rustshed/option_result.py index 1bc77000..09bb0e07 100644 --- a/rustshed/option_result.py +++ b/rustshed/option_result.py @@ -29,8 +29,7 @@ def __class_getitem__(cls, item: Any) -> type[ResultShortcutError[E_co]]: return cls -class OptionShortcutError(Exception): - ... +class OptionShortcutError(Exception): ... class _BaseOption(ABC, Generic[T_co]): @@ -342,16 +341,13 @@ def xor(self, optb: Option[T_co]) -> Option[T_co]: return self if optb.is_null() else Null @overload - def zip(self, other: NullType) -> NullType: - ... # pragma: no cover + def zip(self, other: NullType) -> NullType: ... # pragma: no cover @overload - def zip(self, other: Some[U]) -> Some[tuple[T_co, U]]: - ... # pragma: no cover + def zip(self, other: Some[U]) -> Some[tuple[T_co, U]]: ... # pragma: no cover @overload - def zip(self, other: Option[U]) -> Option[tuple[T_co, U]]: - ... # pragma: no cover + def zip(self, other: Option[U]) -> Option[tuple[T_co, U]]: ... # pragma: no cover def zip(self, other: Option[U]) -> Option[tuple[T_co, U]]: match other: @@ -361,16 +357,19 @@ def zip(self, other: Option[U]) -> Option[tuple[T_co, U]]: return Null @overload - def zip_with(self, other: NullType, f: Callable[[T_co, Any], Any]) -> NullType: - ... # pragma: no cover + def zip_with( + self, other: NullType, f: Callable[[T_co, Any], Any] + ) -> NullType: ... # pragma: no cover @overload - def zip_with(self, other: Some[U], f: Callable[[T_co, U], R]) -> Some[R]: - ... # pragma: no cover + def zip_with( + self, other: Some[U], f: Callable[[T_co, U], R] + ) -> Some[R]: ... # pragma: no cover @overload - def zip_with(self, other: Option[U], f: Callable[[T_co, U], R]) -> Option[R]: - ... # pragma: no cover + def zip_with( + self, other: Option[U], f: Callable[[T_co, U], R] + ) -> Option[R]: ... # pragma: no cover def zip_with(self, other: Option[U], f: Callable[[T_co, U], R]) -> Option[R]: match other: @@ -387,16 +386,15 @@ def unzip(self: _BaseOption[tuple[U, R]]) -> tuple[Option[U], Option[R]]: return Null, Null @overload - def transpose(self: Some[Ok[T]]) -> Ok[Some[T]]: - ... # pragma: no cover + def transpose(self: Some[Ok[T]]) -> Ok[Some[T]]: ... # pragma: no cover @overload - def transpose(self: Some[Err[E]]) -> Err[E]: - ... # pragma: no cover + def transpose(self: Some[Err[E]]) -> Err[E]: ... # pragma: no cover @overload - def transpose(self: Option[Result[T, E]]) -> Result[Option[T], E]: - ... # pragma: no cover + def transpose( + self: Option[Result[T, E]] + ) -> Result[Option[T], E]: ... # pragma: no cover def transpose(self: Option[Result[T, E]]) -> Result[Option[T], E]: match self: @@ -409,16 +407,13 @@ def transpose(self: Option[Result[T, E]]) -> Result[Option[T], E]: raise RuntimeError @overload - def flatten(self: Some[NullType]) -> NullType: - ... # pragma: no cover + def flatten(self: Some[NullType]) -> NullType: ... # pragma: no cover @overload - def flatten(self: Some[Some[U]]) -> Some[U]: - ... # pragma: no cover + def flatten(self: Some[Some[U]]) -> Some[U]: ... # pragma: no cover @overload - def flatten(self: Some[Option[U]]) -> Option[U]: - ... # pragma: no cover + def flatten(self: Some[Option[U]]) -> Option[U]: ... # pragma: no cover def flatten(self: Some[NullType | Some[U]]) -> NullType | Some[U]: match self: @@ -495,16 +490,13 @@ def or_else(self, f: Callable[[], Option[T_co]]) -> Option[T_co]: return f() @overload - def xor(self, optb: NullType) -> NullType: - ... # pragma: no cover + def xor(self, optb: NullType) -> NullType: ... # pragma: no cover @overload - def xor(self, optb: Some[T_co]) -> Some[T_co]: - ... # pragma: no cover + def xor(self, optb: Some[T_co]) -> Some[T_co]: ... # pragma: no cover @overload - def xor(self, optb: Option[T_co]) -> Option[T_co]: - ... # pragma: no cover + def xor(self, optb: Option[T_co]) -> Option[T_co]: ... # pragma: no cover def xor(self, optb: Option[T_co]) -> Option[T_co]: return self if optb.is_null() else optb @@ -754,8 +746,7 @@ def transpose(self: _BaseResult[_BaseOption[T], E]) -> Option[Result[T, E]]: @property @abstractmethod - def Q(self) -> T_co: - ... # pragma: no cover + def Q(self) -> T_co: ... # pragma: no cover @dataclass(frozen=True, slots=True) @@ -836,16 +827,13 @@ def contains_err(self, f: Any) -> bool: return False @overload - def transpose(self: Ok[Some[T]]) -> Some[Ok[T]]: - ... # pragma: no cover + def transpose(self: Ok[Some[T]]) -> Some[Ok[T]]: ... # pragma: no cover @overload - def transpose(self: Ok[NullType]) -> NullType: - ... # pragma: no cover + def transpose(self: Ok[NullType]) -> NullType: ... # pragma: no cover @overload - def transpose(self: Ok[Option[T]]) -> Option[Ok[T]]: - ... # pragma: no cover + def transpose(self: Ok[Option[T]]) -> Option[Ok[T]]: ... # pragma: no cover def transpose(self: Ok[Option[T]]) -> Option[Ok[T]]: match self: diff --git a/rustshed/panic.py b/rustshed/panic.py index c97c0236..bde9ebc1 100644 --- a/rustshed/panic.py +++ b/rustshed/panic.py @@ -1,2 +1 @@ -class Panic(RuntimeError): - ... # pragma: no cover +class Panic(RuntimeError): ... # pragma: no cover