Skip to content

Commit

Permalink
DX: switch to issue forms
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Sep 28, 2023
1 parent 21cc670 commit e64f42b
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 167 deletions.
32 changes: 0 additions & 32 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

22 changes: 0 additions & 22 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

11 changes: 0 additions & 11 deletions .github/pull_request_template.md

This file was deleted.

2 changes: 0 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
".constraints/*.txt": true,
".github/workflows/cd.yml": true,
".github/workflows/ci.yml": true,
"src/repoma/.github/ISSUE_TEMPLATE": true,
"src/repoma/.github/pull_request_template.md": true,
"src/repoma/.github/workflows/clean-caches.yml": true,
"src/repoma/.github/workflows/pr-linting.yml": true,
"src/repoma/.github/workflows/release-drafter.yml": true,
Expand Down
1 change: 0 additions & 1 deletion src/repoma/.github/ISSUE_TEMPLATE

This file was deleted.

1 change: 0 additions & 1 deletion src/repoma/.github/pull_request_template.md

This file was deleted.

10 changes: 7 additions & 3 deletions src/repoma/check_dev_files/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
cspell,
editorconfig,
github_labels,
github_templates,
github_workflows,
gitpod,
mypy,
Expand Down Expand Up @@ -65,6 +64,12 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
required=False,
type=str,
)
parser.add_argument(

Check warning on line 67 in src/repoma/check_dev_files/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/repoma/check_dev_files/__init__.py#L67

Added line #L67 was not covered by tests
"--keep-issue-templates",
help="Do not remove the .github/ISSUE_TEMPLATE directory",
action="store_true",
default=False,
)
parser.add_argument(
"--ignore-author",
action="store_true",
Expand Down Expand Up @@ -165,7 +170,6 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
executor(editorconfig.main, args.no_python)
if not args.allow_labels:
executor(github_labels.main)
executor(github_templates.main)
executor(
github_workflows.main,
allow_deprecated=args.allow_deprecated_workflows,
Expand Down Expand Up @@ -194,7 +198,7 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
executor(pyupgrade.main)
executor(ruff.main)
executor(setup_cfg.main, args.ignore_author)
executor(remove_deprecated_tools)
executor(remove_deprecated_tools, args.keep_issue_templates)

Check warning on line 201 in src/repoma/check_dev_files/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/repoma/check_dev_files/__init__.py#L201

Added line #L201 was not covered by tests
executor(vscode.main)
if not args.no_gitpod:
executor(gitpod.main)
Expand Down
19 changes: 17 additions & 2 deletions src/repoma/check_dev_files/deprecated.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Remove deprecated linters and formatters."""
import os
import shutil
from typing import TYPE_CHECKING, List

from repoma.errors import PrecommitError
Expand All @@ -18,10 +19,12 @@
from tomlkit.items import Table


def remove_deprecated_tools() -> None:
def remove_deprecated_tools(keep_issue_templates: bool) -> None:
executor = Executor()
executor(_remove_flake8)
executor(_remove_isort)
if not keep_issue_templates:
executor(_remove_github_issue_templates)

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

View check run for this annotation

Codecov / codecov/patch

src/repoma/check_dev_files/deprecated.py#L27

Added line #L27 was not covered by tests
executor(_remove_pydocstyle)
executor(_remove_pylint)
executor.finalize()
Expand Down Expand Up @@ -85,6 +88,15 @@ def __remove_nbqa_option(option: str) -> None:
raise PrecommitError(msg)


def _remove_github_issue_templates() -> None:
__remove_configs(

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

View check run for this annotation

Codecov / codecov/patch

src/repoma/check_dev_files/deprecated.py#L92

Added line #L92 was not covered by tests
[
".github/ISSUE_TEMPLATE",
".github/pull_request_template.md",
]
)


def _remove_pydocstyle() -> None:
executor = Executor()
executor(
Expand Down Expand Up @@ -122,7 +134,10 @@ def __remove_configs(paths: List[str]) -> None:
def __remove_file(path: str) -> None:
if not os.path.exists(path):
return
os.remove(path)
if os.path.isdir(path):
shutil.rmtree(path)

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

View check run for this annotation

Codecov / codecov/patch

src/repoma/check_dev_files/deprecated.py#L138

Added line #L138 was not covered by tests
else:
os.remove(path)

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

View check run for this annotation

Codecov / codecov/patch

src/repoma/check_dev_files/deprecated.py#L140

Added line #L140 was not covered by tests
msg = f"Removed {path}"
raise PrecommitError(msg)

Expand Down
83 changes: 0 additions & 83 deletions src/repoma/check_dev_files/github_templates.py

This file was deleted.

10 changes: 0 additions & 10 deletions tests/check_dev_files/test_github_templates.py

This file was deleted.

0 comments on commit e64f42b

Please sign in to comment.