Skip to content

Commit

Permalink
make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
aquamatthias committed Jan 5, 2024
1 parent 8aff3b6 commit 78989d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion resotolib/resotolib/baseresources.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,4 +1307,4 @@ def delete(self, graph: Any) -> bool:
return False


resolve_types(BaseResource) # type: ignore
resolve_types(BaseResource) # noqa
8 changes: 4 additions & 4 deletions resotolib/resotolib/core/model_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def check(to_check: type) -> None:
elif is_collection(clazz):
check(type_arg(to_check))
elif attrs.has(clazz):
resolve_types(clazz) # type: ignore
resolve_types(clazz)
all_classes.add(clazz)
for mro_clazz in clazz.mro()[1:]:
check(mro_clazz)
Expand Down Expand Up @@ -212,7 +212,7 @@ def json(

for cls in classes:
if attrs.has(cls):
resolve_types(cls) # type: ignore # make sure all string based types are resolved correctly
resolve_types(cls)
model: List[Json] = []
all_classes = transitive_classes(classes, walk_subclasses)

Expand Down Expand Up @@ -277,7 +277,7 @@ def literal_name(en: Enum) -> str:

for cls in all_classes:
if attrs.has(cls):
resolve_types(cls) # type: ignore # make sure all string based types are resolved correctly
resolve_types(cls)
export_data_class(cls)
elif is_enum(cls):
export_enum(cls)
Expand Down Expand Up @@ -354,7 +354,7 @@ def node_to_dict(node: BaseResource, changes_only: bool = False, include_revisio
def locate_python_type(python_type: str) -> Any:
cls: Type[Any] = locate(python_type) # type: ignore
if attrs.has(cls):
attrs.resolve_types(cls) # type: ignore
attrs.resolve_types(cls)
return cls


Expand Down
2 changes: 1 addition & 1 deletion resotolib/resotolib/graph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def export_model(graph: Optional[Graph] = None, **kwargs: Any) -> List[Json]:

@lru_cache(maxsize=4096) # Only resolve types once per type
def resolve_type(clazz: Type[Any]) -> None:
resolve_types(clazz) # type: ignore
resolve_types(clazz)


def validate_dataclass(node: BaseResource) -> bool:
Expand Down

0 comments on commit 78989d6

Please sign in to comment.