Skip to content
Snippets Groups Projects
Verified Commit 061a1db8 authored by Romain Deville's avatar Romain Deville
Browse files

:art: Improve plugins.py via black in tox

parent 4e46e9bf
No related branches found
No related tags found
No related merge requests found
Pipeline #9388 canceled with stages
......@@ -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 © {curr_year}"
env.variables["date_copyright"] = f"Copyright © {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:
......
......@@ -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 © {curr_year}"
env.variables["date_copyright"] = f"Copyright © {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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment