From ecf2777b242591c15fe89ee643b9ad85199210c8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 17:47:19 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/talondoc/analysis/registry/__init__.py | 31 +++++++++---------- .../analysis/registry/data/__init__.py | 6 ++-- src/talondoc/analysis/registry/data/abc.py | 6 ++-- src/talondoc/analysis/static/python/shims.py | 6 ++-- 4 files changed, 21 insertions(+), 28 deletions(-) diff --git a/src/talondoc/analysis/registry/__init__.py b/src/talondoc/analysis/registry/__init__.py index c451317f2..fa83edee4 100644 --- a/src/talondoc/analysis/registry/__init__.py +++ b/src/talondoc/analysis/registry/__init__.py @@ -86,9 +86,11 @@ def _register_grouped_data(self, value: GroupDataVar) -> GroupDataVar: " ".join( [ f"Found", - "declaration" - if issubclass(value.parent_type, data.Module) - else "override", + ( + "declaration" + if issubclass(value.parent_type, data.Module) + else "override" + ), "for {value.__class__.__name__} {value.name}", ] ) @@ -292,24 +294,21 @@ def lookup( self, cls: type[SimpleDataVar], name: str, - ) -> Optional[SimpleDataVar]: - ... + ) -> Optional[SimpleDataVar]: ... @overload def lookup( self, cls: type[GroupDataVar], name: str, - ) -> Optional[list[GroupDataVar]]: - ... + ) -> Optional[list[GroupDataVar]]: ... @overload def lookup( self, cls: type[data.Callback], name: data.EventCode, - ) -> Optional[Sequence[data.Callback]]: - ... + ) -> Optional[Sequence[data.Callback]]: ... def lookup(self, cls: type[Data], name: Any) -> Optional[Any]: return self._typed_store(cls).get(self.resolve_name(name), None) @@ -497,22 +496,20 @@ def tags(self) -> Mapping[str, data.Tag]: ###################################################################### @overload - def _typed_store(self, cls: type[SimpleDataVar]) -> dict[str, SimpleDataVar]: - ... + def _typed_store(self, cls: type[SimpleDataVar]) -> dict[str, SimpleDataVar]: ... @overload - def _typed_store(self, cls: type[GroupDataVar]) -> dict[str, list[GroupDataVar]]: - ... + def _typed_store( + self, cls: type[GroupDataVar] + ) -> dict[str, list[GroupDataVar]]: ... @overload def _typed_store( self, cls: type[data.Callback] - ) -> dict[data.EventCode, list[data.Callback]]: - ... + ) -> dict[data.EventCode, list[data.Callback]]: ... @overload - def _typed_store(self, cls: type[Data]) -> dict[Any, Any]: - ... + def _typed_store(self, cls: type[Data]) -> dict[Any, Any]: ... def _typed_store(self, cls: type[Data]) -> dict[Any, Any]: # If the data is not serialisable, store it in temp_data: diff --git a/src/talondoc/analysis/registry/data/__init__.py b/src/talondoc/analysis/registry/data/__init__.py index 6de3013b3..f0dcb020f 100644 --- a/src/talondoc/analysis/registry/data/__init__.py +++ b/src/talondoc/analysis/registry/data/__init__.py @@ -335,9 +335,9 @@ def always_on(self) -> bool: # Common Decoders - Cont'd ############################################################################## -field_parent_type: Callable[ - [JsonValue], Union[type[Module], type[Context]] -] = parse_field("parent_type", parse_class(Module, Context)) +field_parent_type: Callable[[JsonValue], Union[type[Module], type[Context]]] = ( + parse_field("parent_type", parse_class(Module, Context)) +) ############################################################################## diff --git a/src/talondoc/analysis/registry/data/abc.py b/src/talondoc/analysis/registry/data/abc.py index d37e97d77..9e8fe9141 100644 --- a/src/talondoc/analysis/registry/data/abc.py +++ b/src/talondoc/analysis/registry/data/abc.py @@ -204,12 +204,10 @@ class GroupData(Data): @classmethod @abstractmethod - def from_dict(cls, value: JsonValue) -> Self: - ... + def from_dict(cls, value: JsonValue) -> Self: ... @abstractmethod - def to_dict(self) -> dict[str, JsonValue]: - ... + def to_dict(self) -> dict[str, JsonValue]: ... GroupDataVar = TypeVar( diff --git a/src/talondoc/analysis/static/python/shims.py b/src/talondoc/analysis/static/python/shims.py index 3c97fbab7..618bd94f9 100644 --- a/src/talondoc/analysis/static/python/shims.py +++ b/src/talondoc/analysis/static/python/shims.py @@ -290,12 +290,10 @@ def update(self, values: Sequence[str]) -> None: self._add_tag_import(name) @overload - def __getitem__(self, index: int) -> str: - ... + def __getitem__(self, index: int) -> str: ... @overload - def __getitem__(self, index: slice) -> Sequence[str]: - ... + def __getitem__(self, index: slice) -> Sequence[str]: ... def __getitem__(self, _index: Any) -> Sequence[Any]: raise NotImplementedError()