diff --git a/src/talondoc/analysis/registry/__init__.py b/src/talondoc/analysis/registry/__init__.py index c451317f..fa83edee 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 6de3013b..f0dcb020 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 d37e97d7..9e8fe914 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 3c97fbab..618bd94f 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()