Skip to content

Commit

Permalink
ENH: remove GitPod badge and config simultaneously
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Sep 5, 2024
1 parent 25512e4 commit 9835276
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/compwa_policy/check_dev_files/gitpod.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from compwa_policy.errors import PrecommitError
from compwa_policy.utilities import COMPWA_POLICY_DIR, CONFIG_PATH
from compwa_policy.utilities.executor import Executor
from compwa_policy.utilities.pyproject import (
Pyproject,
PythonVersion,
Expand All @@ -18,11 +19,9 @@

def main(use_gitpod: bool, python_version: PythonVersion) -> None:
if not use_gitpod:
if CONFIG_PATH.gitpod.exists():
os.remove(CONFIG_PATH.gitpod)
msg = f"Removed {CONFIG_PATH.gitpod} (add back by setting --gitpod)"
raise PrecommitError(msg)
remove_badge(r"\[!\[GitPod\]\(https://img.shields.io/badge/gitpod")
with Executor() as do:
do(remove_gitpod_config)
do(remove_badge, r"\[!\[GitPod\]\(https://img.shields.io/badge/gitpod")
return
error_message = ""
expected_config = _generate_gitpod_config(python_version)
Expand All @@ -46,6 +45,13 @@ def main(use_gitpod: bool, python_version: PythonVersion) -> None:
pass


def remove_gitpod_config() -> None:
if CONFIG_PATH.gitpod.exists():
os.remove(CONFIG_PATH.gitpod)
msg = f"Removed {CONFIG_PATH.gitpod} (add back by setting --gitpod)"
raise PrecommitError(msg)


def _extract_extensions() -> dict:
if CONFIG_PATH.vscode_extensions.exists():
with open(CONFIG_PATH.vscode_extensions) as stream:
Expand Down

0 comments on commit 9835276

Please sign in to comment.