Skip to content

Commit

Permalink
DX: remove docs/_relink_references.py script (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer authored Dec 3, 2023
1 parent ac32680 commit ecba93d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/repoma/check_dev_files/deprecated.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()


Expand All @@ -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)

0 comments on commit ecba93d

Please sign in to comment.