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

:pencil: use dockerized flake8

parent 10c92ce69e2f
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@
_logger = logging.getLogger(__name__)
__version__ = '1.1.5'
__version__ = '1.1.6'
__date__ = '2017-08-11'
__updated__ = '2018-08-20'
......@@ -58,6 +58,6 @@
return None
def flake8():
"""Run flake8 if found
def flake8(odoo_type):
"""Run flake8
"""
......@@ -63,5 +63,5 @@
"""
if which('flake8'):
_logger.info('Running flake8')
call(['flake8'])
_logger.info('Running flake8')
if odoo_type in ('odoo7', 'odoo8', 'odoo9', 'odoo10'):
image = 'xcgd/flake8:2'
else:
......@@ -67,5 +67,9 @@
else:
_logger.warning('No flake8 in PATH')
image = 'xcgd/flake8:3'
call([
'docker', 'run', '--rm', '--volume',
'{}:/mnt'.format(os.environ['PWD']), image,
'/mnt'])
def isort():
......@@ -77,6 +81,7 @@
'{}:/mnt'.format(os.environ['PWD']), 'xcgd/isort',
'sh', '-c', 'cd /mnt && isort -c'])
def main(argv=None): # IGNORE:C0111
"""Parse arguments and launch conversion
"""
......@@ -612,7 +617,7 @@
arg.append(','.join(all_addons_dir))
if run_flake8:
flake8()
flake8(odoo_type)
if run_isort:
isort()
......
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