-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_all_tests_and_lint.py
44 lines (32 loc) · 1.14 KB
/
run_all_tests_and_lint.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
"""Script to run each tests and lint.
"""
import logging
import os
import numdoclint
log_format: str = \
'-----------------------------------------\n'\
'%(levelname)s : %(asctime)s : %(message)s'
logging.basicConfig(level=logging.DEBUG, format=log_format)
def main() -> None:
"""
Run tests and lint when executed via the command line.
"""
logging.info('[Lint] autoflake started.')
os.system(
'autoflake --in-place --remove-unused-variables '
'--remove-all-unused-imports -r ./')
logging.info('[Lint] autopep8 started.')
os.system('autopep8 --in-place --aggressive --aggressive --recursive ./')
logging.info('[Lint] isort started.')
os.system('isort -rc ./')
logging.info('[Lint] flake8 started.')
os.system('flake8 ./')
logging.info('[Lint] numdoclint started.')
numdoclint.check_python_module_recursively(
dir_path='./',
enable_default_or_optional_doc_check=True,
ignore_func_name_prefix_list=['test_', 'sample_', '__init__'])
logging.info('[Testing] pytest started.')
os.system('pytest --cov=numdoclint tests/')
if __name__ == '__main__':
main()