From ecba93d45ddf528875b6d587c058f4aef808c3c4 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Sun, 3 Dec 2023 18:39:28 +0100 Subject: [PATCH] DX: remove `docs/_relink_references.py` script (#237) Use https://pypi.org/project/sphinx-api-relink instead. --- src/repoma/check_dev_files/deprecated.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/repoma/check_dev_files/deprecated.py b/src/repoma/check_dev_files/deprecated.py index 099bb7ec..01e170a9 100644 --- a/src/repoma/check_dev_files/deprecated.py +++ b/src/repoma/check_dev_files/deprecated.py @@ -1,5 +1,8 @@ """Remove deprecated linters and formatters.""" +import os + +from repoma.errors import PrecommitError from repoma.utilities import remove_configs, remove_from_gitignore from repoma.utilities.executor import Executor from repoma.utilities.precommit import remove_precommit_hook @@ -11,6 +14,8 @@ def remove_deprecated_tools(keep_issue_templates: bool) -> None: if not keep_issue_templates: executor(_remove_github_issue_templates) executor(_remove_markdownlint) + for directory in ["docs", "doc"]: + executor(_remove_relink_references, directory) executor.finalize() @@ -35,3 +40,14 @@ def _remove_markdownlint() -> None: ) executor(remove_precommit_hook, "markdownlint") executor.finalize() + + +def _remove_relink_references(directory: str) -> None: + path = f"{directory}/_relink_references.py" + if not os.path.exists(path): + return + msg = ( + f"Please remove {path!r} and use https://pypi.org/project/sphinx-api-relink" + " instead." + ) + raise PrecommitError(msg)