MCPcopy Index your code
hub / github.com/astral-sh/python-build-standalone / run

Function run

check.py:23–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22
23def run():
24 env = dict(os.environ)
25 env["PYTHONUNBUFFERED"] = "1"
26
27 parser = argparse.ArgumentParser(description="Check code.")
28 parser.add_argument(
29 "--fix",
30 action="store_true",
31 help="Fix problems",
32 )
33 args = parser.parse_args()
34
35 check_args = []
36 format_args = []
37 mypy_args = []
38
39 if args.fix:
40 check_args.append("--fix")
41 else:
42 format_args.append("--check")
43
44 check_result = run_command(["ruff", "check"] + check_args)
45 format_result = run_command(["ruff", "format"] + format_args)
46 mypy_result = run_command(["mypy"] + mypy_args)
47
48 if check_result + format_result + mypy_result:
49 print("Checks failed!")
50 sys.exit(1)
51 else:
52 print("Checks passed!")
53
54
55if __name__ == "__main__":

Callers 1

check.pyFile · 0.70

Calls 1

run_commandFunction · 0.85

Tested by

no test coverage detected