# This file is part of machinis . # # All rights reserved # # Copyright (C) 2022-2022 Fuwn # SPDX-License-Identifier: UNLICENSED # type: ignore import subprocess import sys import sane CC: str = {"win32": "python"}.get(sys.platform, "python3") POETRY: str = {"win32": "poetry.bat"}.get(sys.platform, "poetry") @sane.recipe() def run(): subprocess.run(f"{POETRY} run {CC} -m machinis") @sane.recipe() def fmt(): subprocess.run(f"{POETRY} run black . -q") @sane.recipe() def sort(): subprocess.run(f"{POETRY} run isort machinis make.py") @sane.recipe() def typing(): subprocess.run(f"{POETRY} run mypy . --strict --no-error-summary") @sane.recipe() def spelling(): subprocess.run(f"{POETRY} run codespell machinis make.py") @sane.recipe() def safety(): subprocess.run(f"{POETRY} run safety check --bare") # --full-report @sane.recipe(recipe_deps=["fmt", "sort", "typing", "spelling", "safety"]) def check(): pass sane.sane_run(run)