-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev_commands.py
53 lines (39 loc) · 1.26 KB
/
dev_commands.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from subprocess import check_call
def hooks() -> None:
check_call(["pre-commit", "run", "--all-files"])
def format() -> None: # pylint: disable=redefined-builtin
check_call(["black", "."])
check_call(["isort", "."])
check_call(
[
"autoflake",
"--in-place",
"--recursive",
"--remove-all-unused-imports",
"--remove-unused-variables",
"--ignore-init-module-imports",
".",
]
)
def lint() -> None:
check_call(["flake8", "src", "tests"])
check_call(["pylint", "src", "tests"])
# check_call(["mypy", "src", "tests"]) # TODO
check_call(["bandit", "-r", "src"])
def test() -> None:
check_call(["pytest"])
def test_cov_term() -> None:
check_call(["pytest", "--cov=src", "--cov-branch", "--cov-report=term-missing"])
def test_cov_html() -> None:
check_call(["pytest", "--cov=src", "--cov-branch", "--cov-report=html:test_results/htmlcov"])
def test_ci() -> None:
check_call(
[
"pytest",
"--cov=src",
"--cov-branch",
"--cov-report=xml:test_results/coverage.xml",
"--cov-report=html:test_results/htmlcov",
"--junitxml=test_results/tests.xml",
]
)