-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.py
More file actions
27 lines (23 loc) · 753 Bytes
/
dev.py
File metadata and controls
27 lines (23 loc) · 753 Bytes
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
#!/usr/bin/env python3
import argparse
import shlex
import subprocess
import sys
parser = argparse.ArgumentParser(
description='Helper-script for various tasks during development.'
)
commands = parser.add_subparsers(dest='command')
cq_parser = commands.add_parser('code-quality', help='Run various checks for coding standards.')
args = parser.parse_args()
if args.command == 'code-quality':
commands = [
'isort --check-only --diff -rc admin/ dev.py',
'flake8 admin/ dev.py',
'python -Wd admin/manage.py check',
]
for cmd in commands:
print('+', cmd)
try:
subprocess.check_call(shlex.split(cmd))
except subprocess.CalledProcessError as e:
sys.exit(e.returncode)