run_checks.py (695e26030858b27648ca107b77095fed53377b4b) | run_checks.py (1da2e6220e1115930694c649605534baf6fa3dea) |
---|---|
1#!/usr/bin/env python3 2# SPDX-License-Identifier: GPL-2.0 3# 4# This file runs some basic checks to verify kunit works. 5# It is only of interest if you're making changes to KUnit itself. 6# 7# Copyright (C) 2021, Google LLC. 8# Author: Daniel Latypov <dlatypov@google.com.com> --- 9 unchanged lines hidden (view full) --- 18 19ABS_TOOL_PATH = os.path.abspath(os.path.dirname(__file__)) 20TIMEOUT = datetime.timedelta(minutes=5).total_seconds() 21 22commands: Dict[str, Sequence[str]] = { 23 'kunit_tool_test.py': ['./kunit_tool_test.py'], 24 'kunit smoke test': ['./kunit.py', 'run', '--kunitconfig=lib/kunit', '--build_dir=kunit_run_checks'], 25 'pytype': ['/bin/sh', '-c', 'pytype *.py'], | 1#!/usr/bin/env python3 2# SPDX-License-Identifier: GPL-2.0 3# 4# This file runs some basic checks to verify kunit works. 5# It is only of interest if you're making changes to KUnit itself. 6# 7# Copyright (C) 2021, Google LLC. 8# Author: Daniel Latypov <dlatypov@google.com.com> --- 9 unchanged lines hidden (view full) --- 18 19ABS_TOOL_PATH = os.path.abspath(os.path.dirname(__file__)) 20TIMEOUT = datetime.timedelta(minutes=5).total_seconds() 21 22commands: Dict[str, Sequence[str]] = { 23 'kunit_tool_test.py': ['./kunit_tool_test.py'], 24 'kunit smoke test': ['./kunit.py', 'run', '--kunitconfig=lib/kunit', '--build_dir=kunit_run_checks'], 25 'pytype': ['/bin/sh', '-c', 'pytype *.py'], |
26 'mypy': ['/bin/sh', '-c', 'mypy *.py'], | 26 'mypy': ['mypy', '--strict', '--exclude', '_test.py$', '--exclude', 'qemu_configs/', '.'], |
27} 28 29# The user might not have mypy or pytype installed, skip them if so. 30# Note: you can install both via `$ pip install mypy pytype` 31necessary_deps : Dict[str, str] = { 32 'pytype': 'pytype', 33 'mypy': 'mypy', 34} --- 33 unchanged lines hidden (view full) --- 68 if output: 69 print(textwrap.indent(output.decode(), '> ')) 70 executor.shutdown() 71 72 if has_failures: 73 sys.exit(1) 74 75 | 27} 28 29# The user might not have mypy or pytype installed, skip them if so. 30# Note: you can install both via `$ pip install mypy pytype` 31necessary_deps : Dict[str, str] = { 32 'pytype': 'pytype', 33 'mypy': 'mypy', 34} --- 33 unchanged lines hidden (view full) --- 68 if output: 69 print(textwrap.indent(output.decode(), '> ')) 70 executor.shutdown() 71 72 if has_failures: 73 sys.exit(1) 74 75 |
76def run_cmd(argv: Sequence[str]): | 76def run_cmd(argv: Sequence[str]) -> None: |
77 subprocess.check_output(argv, stderr=subprocess.STDOUT, cwd=ABS_TOOL_PATH, timeout=TIMEOUT) 78 79 80if __name__ == '__main__': 81 main(sys.argv[1:]) | 77 subprocess.check_output(argv, stderr=subprocess.STDOUT, cwd=ABS_TOOL_PATH, timeout=TIMEOUT) 78 79 80if __name__ == '__main__': 81 main(sys.argv[1:]) |