Skip to content

Commit 3423f5c

Browse files
committed
docs: Use and enforce imperative mood
1 parent bfc98dd commit 3423f5c

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ ignore = [
7878
"D100", # Missing docstring in public module
7979
"D104", # Missing docstring in public package
8080
"D107", # Missing docstring in `__init__`
81+
"D203", # One blank line required before class docstring
82+
"D213", # Multi-line docstring summary should start at the second line
83+
"D413", # Missing blank line after last section
8184
"EM", # flake8-errmsg
8285
"G004", # Logging statement uses f-string
8386
"ISC001", # This rule may cause conflicts when used with the formatter
@@ -137,9 +140,6 @@ inline-quotes = "single"
137140
[tool.ruff.lint.flake8-builtins]
138141
builtins-ignorelist = ["id"]
139142

140-
[tool.ruff.lint.pydocstyle]
141-
convention = "google"
142-
143143
[tool.ruff.lint.isort]
144144
known-local-folder = ["apify_client"]
145145

src/apify_client/_errors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ApifyApiError(ApifyClientError):
1818

1919
@ignore_docs
2020
def __init__(self, response: httpx.Response, attempt: int) -> None:
21-
"""A default constructor.
21+
"""Initialize a new instance.
2222
2323
Args:
2424
response: The response to the failed API call.
@@ -62,7 +62,7 @@ class InvalidResponseBodyError(ApifyClientError):
6262

6363
@ignore_docs
6464
def __init__(self, response: httpx.Response) -> None:
65-
"""A default constructor.
65+
"""Initialize a new instance.
6666
6767
Args:
6868
response: The response which failed to be parsed.

src/apify_client/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __init__(
7070
min_delay_between_retries_millis: int | None = 500,
7171
timeout_secs: int | None = 360,
7272
) -> None:
73-
"""A default constructor.
73+
"""Initialize a new instance.
7474
7575
Args:
7676
token: The Apify API token.
@@ -109,7 +109,7 @@ def __init__(
109109
min_delay_between_retries_millis: int | None = 500,
110110
timeout_secs: int | None = 360,
111111
) -> None:
112-
"""A default constructor.
112+
"""Initialize a new instance.
113113
114114
Args:
115115
token: The Apify API token.
@@ -292,7 +292,7 @@ def __init__(
292292
min_delay_between_retries_millis: int | None = 500,
293293
timeout_secs: int | None = 360,
294294
) -> None:
295-
"""A default constructor.
295+
"""Initialize a new instance.
296296
297297
Args:
298298
token: The Apify API token.

src/apify_client/clients/base/base_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def __init__(
6363
resource_path: str,
6464
params: dict | None = None,
6565
) -> None:
66-
"""A default constructor.
66+
"""Initialize a new instance.
6767
6868
Args:
6969
base_url: Base URL of the API server.
@@ -106,7 +106,7 @@ def __init__(
106106
resource_path: str,
107107
params: dict | None = None,
108108
) -> None:
109-
"""A default constructor.
109+
"""Initialize a new instance.
110110
111111
Args:
112112
base_url: Base URL of the API server.

src/apify_client/clients/resource_clients/actor_env_var.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def get_actor_env_var_representation(
1313
name: str | None = None,
1414
value: str | None = None,
1515
) -> dict:
16-
"""Returns an environment variable representation of the Actor in a dictionary."""
16+
"""Return an environment variable representation of the Actor in a dictionary."""
1717
return {
1818
'isSecret': is_secret,
1919
'name': name,

src/apify_client/clients/resource_clients/request_queue.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __init__( # noqa: D417
6161
client_key: str | None = None,
6262
**kwargs: Any,
6363
) -> None:
64-
"""A default constructor.
64+
"""Initialize a new instance.
6565
6666
Args:
6767
client_key: A unique identifier of the client accessing the request queue.
@@ -415,7 +415,7 @@ def __init__( # noqa: D417
415415
client_key: str | None = None,
416416
**kwargs: Any,
417417
) -> None:
418-
"""A default constructor.
418+
"""Initialize a new instance.
419419
420420
Args:
421421
client_key: A unique identifier of the client accessing the request queue.
@@ -648,7 +648,7 @@ async def _batch_add_requests_worker(
648648
649649
This worker will process batches from the queue, retrying requests that fail until the retry limit is reached.
650650
651-
Returns result containing lists of processed and unprocessed requests by the worker.
651+
Return result containing lists of processed and unprocessed requests by the worker.
652652
"""
653653
processed_requests = list[dict]()
654654
unprocessed_requests = list[dict]()

src/apify_client/clients/resource_clients/user.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def monthly_usage(self) -> dict | None:
5858
return None
5959

6060
def limits(self) -> dict | None:
61-
"""Returns a complete summary of the user account's limits.
61+
"""Return a complete summary of the user account's limits.
6262
6363
It is the same information which is available on the account's Limits page. The returned data includes
6464
the current usage cycle, a summary of the account's limits, and the current usage.
@@ -87,7 +87,7 @@ def update_limits(
8787
max_monthly_usage_usd: int | None = None,
8888
data_retention_days: int | None = None,
8989
) -> None:
90-
"""Updates the account's limits manageable on your account's Limits page."""
90+
"""Update the account's limits manageable on your account's Limits page."""
9191
self.http_client.call(
9292
url=self._url('limits'),
9393
method='PUT',
@@ -150,7 +150,7 @@ async def monthly_usage(self) -> dict | None:
150150
return None
151151

152152
async def limits(self) -> dict | None:
153-
"""Returns a complete summary of the user account's limits.
153+
"""Return a complete summary of the user account's limits.
154154
155155
It is the same information which is available on the account's Limits page. The returned data includes
156156
the current usage cycle, a summary of the account's limits, and the current usage.
@@ -179,7 +179,7 @@ async def update_limits(
179179
max_monthly_usage_usd: int | None = None,
180180
data_retention_days: int | None = None,
181181
) -> None:
182-
"""Updates the account's limits manageable on your account's Limits page."""
182+
"""Update the account's limits manageable on your account's Limits page."""
183183
await self.http_client.call(
184184
url=self._url('limits'),
185185
method='PUT',

0 commit comments

Comments
 (0)