Skip to content

Commit 4b353cf

Browse files
committed
chore(ruff): fix pydocstyle violations
- use imperative mood - end sentence with punctuation - add an empty line between summary and body Many of the affected docstrings are used in the CLI interface, but these rules should apply to command `--help` outputs as well.
1 parent 21239f8 commit 4b353cf

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

onekey_client/cli/ci.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def ci_result(
301301
check_interval: int,
302302
junit_path: Path | None,
303303
):
304-
"""Fetch analysis results for CI"""
304+
"""Fetch analysis results for CI."""
305305
handler = ResultHandler(
306306
client,
307307
firmware_id,

onekey_client/cli/firmware_upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def upload_firmware(
4444
name: str | None,
4545
filename: Path,
4646
):
47-
"""Uploads a firmware to the ONEKEY platform"""
47+
"""Upload a firmware to the ONEKEY platform."""
4848
product_group_id = _get_product_group_id_by_name(client, product_group_name)
4949
analysis_configuration_id = _get_analysis_configuration_id_by_name(
5050
client, analysis_configuration_name

onekey_client/cli/misc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@click.command()
99
@click.pass_obj
1010
def list_tenants(client: Client):
11-
"""List available tenants"""
11+
"""List available tenants."""
1212
tenants = client.get_all_tenants()
1313
for tenant in tenants:
1414
click.echo(f"{tenant.name} ({tenant.id}")
@@ -17,5 +17,5 @@ def list_tenants(client: Client):
1717
@click.command()
1818
@click.pass_obj
1919
def get_tenant_token(client: Client):
20-
"""Get tenant specific Bearer token"""
20+
"""Get tenant specific Bearer token."""
2121
click.echo(json.dumps(client.get_auth_headers()))

onekey_client/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def refresh_tenant_token(self):
178178

179179
@_tenant_required
180180
def query(self, query: str, variables: dict | None = None, timeout=60):
181-
"""Issues a GraphQL query and returns the results"""
181+
"""Issues a GraphQL query and returns the results."""
182182
res = self._post_with_token(
183183
"/graphql", json={"query": query, "variables": variables}, timeout=timeout
184184
)
@@ -266,6 +266,7 @@ def _verify_token(
266266

267267
class _LoginState:
268268
"""Keeps state after login.
269+
269270
Client.logout() will simply delete the instance from memory.
270271
"""
271272

0 commit comments

Comments
 (0)