Commit f9f6e096 by Christine Lytwynec

fix for pylint/pep8 defaults

parent 550d0543
...@@ -32,39 +32,40 @@ def run_pylint(options): ...@@ -32,39 +32,40 @@ def run_pylint(options):
""" """
Run pylint on system code Run pylint on system code
""" """
system = getattr(options, 'system', 'lms')
errors = getattr(options, 'errors', False) errors = getattr(options, 'errors', False)
systems = getattr(options, 'system', 'lms,cms,common').split(',')
# Directory to put the pylint report in. for system in systems:
# This makes the folder if it doesn't already exist. # Directory to put the pylint report in.
report_dir = get_or_make_dir(os.path.join(Env.REPORT_DIR, system)) # This makes the folder if it doesn't already exist.
report_dir = get_or_make_dir(os.path.join(Env.REPORT_DIR, system))
flags = '-E' if errors else '' flags = '-E' if errors else ''
apps = [system] apps = [system]
for directory in ['djangoapps', 'lib']: for directory in ['djangoapps', 'lib']:
dirs = os.listdir(os.path.join(system, directory)) dirs = os.listdir(os.path.join(system, directory))
apps.extend([d for d in dirs if os.path.isdir(os.path.join(system, directory, d))]) apps.extend([d for d in dirs if os.path.isdir(os.path.join(system, directory, d))])
apps_list = ' '.join(apps) apps_list = ' '.join(apps)
pythonpath_prefix = ( pythonpath_prefix = (
"PYTHONPATH={system}:{system}/djangoapps:{system}/" "PYTHONPATH={system}:{system}/djangoapps:{system}/"
"lib:common/djangoapps:common/lib".format( "lib:common/djangoapps:common/lib".format(
system=system system=system
)
) )
)
sh( sh(
"{pythonpath_prefix} pylint {flags} -f parseable {apps} | " "{pythonpath_prefix} pylint {flags} -f parseable {apps} | "
"tee {report_dir}/pylint.report".format( "tee {report_dir}/pylint.report".format(
pythonpath_prefix=pythonpath_prefix, pythonpath_prefix=pythonpath_prefix,
flags=flags, flags=flags,
apps=apps_list, apps=apps_list,
report_dir=report_dir report_dir=report_dir
)
) )
)
@task @task
...@@ -76,13 +77,14 @@ def run_pep8(options): ...@@ -76,13 +77,14 @@ def run_pep8(options):
""" """
Run pep8 on system code Run pep8 on system code
""" """
system = getattr(options, 'system', 'lms') systems = getattr(options, 'system', 'lms,cms,common').split(',')
# Directory to put the pep8 report in. for system in systems:
# This makes the folder if it doesn't already exist. # Directory to put the pep8 report in.
report_dir = get_or_make_dir(os.path.join(Env.REPORT_DIR, system)) # This makes the folder if it doesn't already exist.
report_dir = get_or_make_dir(os.path.join(Env.REPORT_DIR, system))
sh('pep8 {system} | tee {report_dir}/pep8.report'.format(system=system, report_dir=report_dir)) sh('pep8 {system} | tee {report_dir}/pep8.report'.format(system=system, report_dir=report_dir))
@task @task
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment