From b15c780e11be6074037ab4c2e4cc8be9bbaae1f1 Mon Sep 17 00:00:00 2001
From: Yoann Schneider <yschneider@teklia.com>
Date: Wed, 24 Apr 2024 07:29:55 +0000
Subject: [PATCH] Introduce docstyle D301

---
 arkindex/process/api.py | 30 ++++++++++++++++++------------
 ruff.toml               |  2 ++
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/arkindex/process/api.py b/arkindex/process/api.py
index 8d478b2aa9..f527305661 100644
--- a/arkindex/process/api.py
+++ b/arkindex/process/api.py
@@ -402,8 +402,9 @@ class ProcessDetails(ProcessACLMixin, ProcessQuerysetMixin, RetrieveUpdateDestro
 
 
 class ProcessRetry(ProcessACLMixin, ProcessQuerysetMixin, GenericAPIView):
-    """
-    Retry a process. Can only be used on processes with Error, Failed, Stopped or Completed states.\n\n
+    r"""
+    Retry a process. Can only be used on processes with Error, Failed, Stopped or Completed states.
+
     Requires an **admin** access to the process and **guest** access to the process' farm.
     """
     permission_classes = (IsVerified, )
@@ -476,8 +477,9 @@ class FilesProcess(CreateAPIView):
     )
 )
 class CorpusProcess(SelectionMixin, CorpusACLMixin, CreateAPIView):
-    """
-    Create a distributed process from elements of an Arkindex corpus.\n\n
+    r"""
+    Create a distributed process from elements of an Arkindex corpus.
+
     Requires an **admin** access to the corpus.
     """
     permission_classes = (IsVerified, )
@@ -542,8 +544,9 @@ class CorpusProcess(SelectionMixin, CorpusACLMixin, CreateAPIView):
     ),
 )
 class StartProcess(CorpusACLMixin, CreateAPIView):
-    """
-    Start a process, used to build a Workflow with Workers.\n\n
+    r"""
+    Start a process, used to build a Workflow with Workers.
+
     Requires an **admin** access to the corpus of this process.
     """
     permission_classes = (IsVerified, )
@@ -1555,8 +1558,9 @@ class WorkerRunDetails(ProcessACLMixin, RetrieveUpdateDestroyAPIView):
     tags=["process"]
 ))
 class ListProcessElements(CorpusACLMixin, ListAPIView):
-    """
-    List all elements for a process with workers.\n\n
+    r"""
+    List all elements for a process with workers.
+
     Requires an **admin** access to the process corpus.
     """
     pagination_class = CountCursorPagination
@@ -1828,8 +1832,9 @@ class WorkerActivityBase(ListAPIView):
     )
 )
 class CorpusWorkersActivity(CorpusACLMixin, WorkerActivityBase):
-    """
-    Retrieve corpus wise statistics about the activity of all its worker processes.\n
+    r"""
+    Retrieve corpus wise statistics about the activity of all its worker processes.
+
     Requires a **guest** access.
     """
 
@@ -1845,8 +1850,9 @@ class CorpusWorkersActivity(CorpusACLMixin, WorkerActivityBase):
     )
 )
 class ProcessWorkersActivity(ProcessACLMixin, WorkerActivityBase):
-    """
-    Retrieve process statistics about the activity of its workers.\n
+    r"""
+    Retrieve process statistics about the activity of its workers.
+
     Requires a **guest** access.
     """
 
diff --git a/ruff.toml b/ruff.toml
index 1be3c758e8..2de455fff8 100644
--- a/ruff.toml
+++ b/ruff.toml
@@ -8,6 +8,8 @@ quote-style = "double"
 select = ["Q0", "F", "W", "E",
     # request-without-timeout
     "S113",
+    # escape-sequence-in-docstring
+    "D301",
     # flake8-return
     "RET",
 ]
-- 
GitLab