From 061a1db8cebe9e1834f52bed0ac5b4103545cff6 Mon Sep 17 00:00:00 2001
From: Romain Deville <code@romaindeville.fr>
Date: Tue, 18 May 2021 12:03:12 +0200
Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Improve=20plugins.py=20via=20bla?=
 =?UTF-8?q?ck=20in=20tox?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 docs/_data/plugins.py           | 21 +++++++++++----------
 templates/docs/_data/plugins.py | 21 +++++++++++----------
 2 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/docs/_data/plugins.py b/docs/_data/plugins.py
index 1b356fe..4b26414 100644
--- a/docs/_data/plugins.py
+++ b/docs/_data/plugins.py
@@ -153,10 +153,14 @@ def add_external_to_nav(
                         repo_parent,
                         nav_parent[1:],
                     )
-    elif repo_dict["online_url"].startswith('/'):
-        nav.append({
-            repo_dict["nav_entry"]: repo_dict["online_url"].replace('/','../',1)
-        })
+    elif repo_dict["online_url"].startswith("/"):
+        nav.append(
+            {
+                repo_dict["nav_entry"]: repo_dict["online_url"].replace(
+                    "/", "../", 1
+                )
+            }
+        )
     else:
         nav.append({repo_dict["nav_entry"]: repo_dict["online_url"]})
 
@@ -406,9 +410,7 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None:
         curr_year = time.strftime("%Y", time.localtime())
 
         if first_year == curr_year:
-            env.variables[
-                "date_copyright"
-            ] = f"Copyright &copy; {curr_year}"
+            env.variables["date_copyright"] = f"Copyright &copy; {curr_year}"
         else:
             env.variables[
                 "date_copyright"
@@ -419,7 +421,6 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None:
         ] = f"{env.variables['date_copyright']} {env.variables['copyright']}"
 
 
-
 def set_repo_name(env: dict, repo_slug: str) -> None:
     """Update content of the `repo_name` key in `env.conf`.
 
@@ -834,8 +835,8 @@ def update_version(env: dict) -> None:
         minor = int(i_tag[1])
         patch = str()
         for i_remain_tag in i_tag[2:]:
-            if i_remain_tag and i_remain_tag not in ("","\n"):
-                i_remain_tag = i_remain_tag.replace("\n","")
+            if i_remain_tag and i_remain_tag not in ("", "\n"):
+                i_remain_tag = i_remain_tag.replace("\n", "")
                 if not patch:
                     patch = f"{i_remain_tag}"
                 else:
diff --git a/templates/docs/_data/plugins.py b/templates/docs/_data/plugins.py
index 1b356fe..4b26414 100644
--- a/templates/docs/_data/plugins.py
+++ b/templates/docs/_data/plugins.py
@@ -153,10 +153,14 @@ def add_external_to_nav(
                         repo_parent,
                         nav_parent[1:],
                     )
-    elif repo_dict["online_url"].startswith('/'):
-        nav.append({
-            repo_dict["nav_entry"]: repo_dict["online_url"].replace('/','../',1)
-        })
+    elif repo_dict["online_url"].startswith("/"):
+        nav.append(
+            {
+                repo_dict["nav_entry"]: repo_dict["online_url"].replace(
+                    "/", "../", 1
+                )
+            }
+        )
     else:
         nav.append({repo_dict["nav_entry"]: repo_dict["online_url"]})
 
@@ -406,9 +410,7 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None:
         curr_year = time.strftime("%Y", time.localtime())
 
         if first_year == curr_year:
-            env.variables[
-                "date_copyright"
-            ] = f"Copyright &copy; {curr_year}"
+            env.variables["date_copyright"] = f"Copyright &copy; {curr_year}"
         else:
             env.variables[
                 "date_copyright"
@@ -419,7 +421,6 @@ def set_copyright(env: dict, git_repo: git.Repo) -> None:
         ] = f"{env.variables['date_copyright']} {env.variables['copyright']}"
 
 
-
 def set_repo_name(env: dict, repo_slug: str) -> None:
     """Update content of the `repo_name` key in `env.conf`.
 
@@ -834,8 +835,8 @@ def update_version(env: dict) -> None:
         minor = int(i_tag[1])
         patch = str()
         for i_remain_tag in i_tag[2:]:
-            if i_remain_tag and i_remain_tag not in ("","\n"):
-                i_remain_tag = i_remain_tag.replace("\n","")
+            if i_remain_tag and i_remain_tag not in ("", "\n"):
+                i_remain_tag = i_remain_tag.replace("\n", "")
                 if not patch:
                     patch = f"{i_remain_tag}"
                 else:
-- 
GitLab