def fmt(targets: List[str], ci: bool = False) -> None: """ Autoformat code. """ black_command = ["black", "--py36"] if ci: black_command.append("--check") pipenv.run(black_command + targets)
def run() -> None: """ Start backend server normally. """ env_variables.set_backend() try: pipenv.run(["flask", "run"]) except KeyboardInterrupt: pass
def run_script() -> None: pipenv.run([ "python", "./backend/src/admin/new_semester_scripts/rebuild_rosters.py" ])
def run_script() -> None: pipenv.run([ "python", "./backend/src/admin/new_semester_scripts/share_drive.py" ])
def test(*, root_directory: str) -> None: """ Run unit tests. """ pipenv.run(["pytest", "--quiet", root_directory])
def lint(targets: List[str]) -> None: """ Run Pylint. """ pipenv.run(["pylint", "--rcfile=backend/.pylintrc"] + targets)
def check_types(targets: List[str]) -> None: """ Calls MyPy to check for type errors. """ pipenv.run(["mypy", "--config-file", "backend/mypy.ini"] + targets)