From 9b6d2549747bab98da8c1c40ff01a07420af3986 Mon Sep 17 00:00:00 2001 From: Javed Habib Date: Fri, 24 May 2024 17:51:54 +0530 Subject: [PATCH] chore: google style docstring --- pyproject.toml | 3 +++ tesk/services/exceptions.py | 9 +++------ tesk/services/filer_class.py | 3 +-- tesk/services/pvc.py | 3 +-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8f95602..84de50f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,6 +68,9 @@ pytest-localftpserver = "*" kubernetes = "*" pytest-cov = "^5.0.0" +[tool.ruff.lint.pydocstyle] +convention = "google" + [tool.ruff.lint] select = [ "E", # pycodestyle diff --git a/tesk/services/exceptions.py b/tesk/services/exceptions.py index 4334706..ff09cdd 100644 --- a/tesk/services/exceptions.py +++ b/tesk/services/exceptions.py @@ -4,8 +4,7 @@ class ServiceStatusCodes: """A class to represent the HTTP status codes. - Attributes - ---------- + Attributes: OK (int): HTTP status code for OK. REDIRECT (int): HTTP status code for Redirect. CREATED (int): HTTP status code for Created. @@ -39,12 +38,10 @@ def get(cls, status_name): """Retrieve the corresponding HTTP status code for a given status name. Args: - ---- - status_name (str): The name of the HTTP status code to retrieve. + status_name (str): The name of the HTTP status code to retrieve. Returns: - ------- - int or None: Corresponding HTTP status code if found, otherwise None. + int or None: Corresponding HTTP status code if found, otherwise None. """ return getattr(cls, status_name.upper(), None) diff --git a/tesk/services/filer_class.py b/tesk/services/filer_class.py index 976bd29..36fdd7f 100644 --- a/tesk/services/filer_class.py +++ b/tesk/services/filer_class.py @@ -129,8 +129,7 @@ def set_backoffLimit(self, limit): this value. Args: - ---- - limit: The number of retries before considering a Job as failed. + limit: The number of retries before considering a Job as failed. """ self.spec['spec'].update({'backoffLimit': limit}) diff --git a/tesk/services/pvc.py b/tesk/services/pvc.py index 3121f5d..83147f8 100644 --- a/tesk/services/pvc.py +++ b/tesk/services/pvc.py @@ -12,8 +12,7 @@ class PVC: def __init__(self, name='task-pvc', size_gb=1, namespace='default'): """Represent a PersistentVolumeClaim object. - Methods - ------- + Methods: set_volume_mounts(mounts): Sets the volume mounts for the PVC. get_subpath(): Generates a subpath for the PVC. create(): Creates the PersistentVolumeClaim.