diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d5e30d8..e292c07 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,6 +30,6 @@ repos: - id: isort args: ["--profile", "black", "--filter-files"] - repo: https://github.com/psf/black - rev: 19.3b0 + rev: 22.3.0 hooks: - id: black diff --git a/joint_teapot/workers/git.py b/joint_teapot/workers/git.py index 25f290d..715740c 100644 --- a/joint_teapot/workers/git.py +++ b/joint_teapot/workers/git.py @@ -7,7 +7,7 @@ from joint_teapot.utils.logger import logger current_path = sys.path[0] sys.path.remove(current_path) -from git import Repo +from git import Repo # type: ignore from git.exc import GitCommandError sys.path.insert(0, current_path) diff --git a/joint_teapot/workers/joj.py b/joint_teapot/workers/joj.py index eea71e8..6d74e6e 100644 --- a/joint_teapot/workers/joj.py +++ b/joint_teapot/workers/joj.py @@ -16,6 +16,8 @@ class JOJ: self.submitter = JOJSubmitter(sid, logger) def submit_dir(self, problem_url: str, path: str, lang: str) -> Tuple[int, str]: + if lang not in list(Language): + raise Exception(f"unsupported language '{lang}' for JOJ") exclude_paths = [".git"] zip_buffer = io.BytesIO() zip_buffer.name = f"{os.path.basename(path)}.zip"