Skip to content

Commit

Permalink
update doc formatter with CogniteResourceList
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonvt committed Aug 15, 2023
1 parent c041b30 commit b499193
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/custom_checks/docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from dataclasses import is_dataclass

from cognite.client._api_client import APIClient
from cognite.client.data_classes._base import CogniteResource
from cognite.client.data_classes._base import CogniteResource, CogniteResourceList
from tests.utils import all_subclasses

CWD = Path.cwd()
Expand Down Expand Up @@ -188,7 +188,12 @@ def format_docstrings_for_subclasses(cls) -> list[str]:


def format_docstrings() -> list[str]:
# TODO: Add more baseclasses to parse, e.g. CogniteResourceList?:
return "\n".join(
sum((format_docstrings_for_subclasses(base_cls) for base_cls in [APIClient, CogniteResource]), [])
sum(
(
format_docstrings_for_subclasses(base_cls)
for base_cls in [APIClient, CogniteResource, CogniteResourceList]
),
[]
)
)

0 comments on commit b499193

Please sign in to comment.