Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX: remove _relink_references.py script #237

Merged
merged 1 commit into from
Dec 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
if not keep_issue_templates:
executor(_remove_github_issue_templates)
executor(_remove_markdownlint)
for directory in ["docs", "doc"]:
executor(_remove_relink_references, directory)

Check warning on line 18 in src/repoma/check_dev_files/deprecated.py

View check run for this annotation

Codecov / codecov/patch

src/repoma/check_dev_files/deprecated.py#L18

Added line #L18 was not covered by tests
executor.finalize()


Expand All @@ -35,3 +40,14 @@
)
executor(remove_precommit_hook, "markdownlint")
executor.finalize()


def _remove_relink_references(directory: str) -> None:
path = f"{directory}/_relink_references.py"

Check warning on line 46 in src/repoma/check_dev_files/deprecated.py

View check run for this annotation

Codecov / codecov/patch

src/repoma/check_dev_files/deprecated.py#L46

Added line #L46 was not covered by tests
if not os.path.exists(path):
return
msg = (

Check warning on line 49 in src/repoma/check_dev_files/deprecated.py

View check run for this annotation

Codecov / codecov/patch

src/repoma/check_dev_files/deprecated.py#L48-L49

Added lines #L48 - L49 were not covered by tests
f"Please remove {path!r} and use https://pypi.org/project/sphinx-api-relink"
" instead."
)
raise PrecommitError(msg)

Check warning on line 53 in src/repoma/check_dev_files/deprecated.py

View check run for this annotation

Codecov / codecov/patch

src/repoma/check_dev_files/deprecated.py#L53

Added line #L53 was not covered by tests
Loading