Skip to content
Snippets Groups Projects
Commit 7c7994ffc45e authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

:pencil: run isort when running a project to detect problems before CI

parent 839e06c99b04
No related branches found
No related tags found
No related merge requests found
......@@ -68,6 +68,16 @@
_logger.warning('No flake8 in PATH')
def isort():
"""Run isort if found
"""
if which('isort'):
_logger.info('Running isort')
call(['isort', '-c'])
else:
_logger.warning('No isort in PATH')
def main(argv=None): # IGNORE:C0111
"""Parse arguments and launch conversion
"""
......@@ -197,6 +207,12 @@
dest='flake8',
)
parser.add_argument(
'--no-isort',
help="Do not run isort",
action='store_false',
dest='isort',
)
parser.add_argument(
'--odoo-help',
help="Pass --help to odoo binary [default: %(default)s]",
action='store_true',
......@@ -275,6 +291,7 @@
use_host_network = nmspc.host_network
start_postgresql = nmspc.start_postgresql
run_flake8 = nmspc.flake8
run_isort = nmspc.isort
odoo_help = nmspc.odoo_help
dev = nmspc.dev
restore_filename = nmspc.DUMP
......@@ -598,6 +615,9 @@
if run_flake8:
flake8()
if run_isort:
isort()
if dev:
if odoo_type in ('odoo11', 'odoo10'):
# ipdb should not be run if not interactive
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment