Commit 4cba033b by Ned Batchelder

Merge pull request #7854 from edx/ned/te-855

Run pylint on all our code, and only our code. TE-855
parents 98a33624 24e0c2c8
...@@ -4,8 +4,8 @@ Acceptance tests for Studio related to the asset index page. ...@@ -4,8 +4,8 @@ Acceptance tests for Studio related to the asset index page.
from ...pages.studio.asset_index import AssetIndexPage from ...pages.studio.asset_index import AssetIndexPage
from acceptance.tests.studio.base_studio_test import StudioCourseTest from .base_studio_test import StudioCourseTest
from acceptance.fixtures.base import StudioApiLoginError from ...fixtures.base import StudioApiLoginError
class AssetIndexTest(StudioCourseTest): class AssetIndexTest(StudioCourseTest):
......
...@@ -3,7 +3,7 @@ Acceptance tests for Studio's Settings Details pages ...@@ -3,7 +3,7 @@ Acceptance tests for Studio's Settings Details pages
""" """
from unittest import skip from unittest import skip
from acceptance.tests.studio.base_studio_test import StudioCourseTest from .base_studio_test import StudioCourseTest
from ...fixtures.course import CourseFixture from ...fixtures.course import CourseFixture
from ...pages.studio.settings import SettingsPage from ...pages.studio.settings import SettingsPage
from ...pages.studio.overview import CourseOutlinePage from ...pages.studio.overview import CourseOutlinePage
......
...@@ -7,7 +7,27 @@ import re ...@@ -7,7 +7,27 @@ import re
from .utils.envs import Env from .utils.envs import Env
ALL_SYSTEMS = 'lms,cms,common' ALL_SYSTEMS = 'lms,cms,common,openedx,pavelib'
def top_python_dirs(dirname):
"""
Find the directories to start from in order to find all the Python files in `dirname`.
"""
top_dirs = []
dir_init = os.path.join(dirname, "__init__.py")
if os.path.exists(dir_init):
top_dirs.append(dirname)
for directory in ['djangoapps', 'lib']:
subdir = os.path.join(dirname, directory)
subdir_init = os.path.join(subdir, "__init__.py")
if os.path.exists(subdir) and not os.path.exists(subdir_init):
dirs = os.listdir(subdir)
top_dirs.extend(d for d in dirs if os.path.isdir(os.path.join(subdir, d)))
return top_dirs
@task @task
...@@ -27,13 +47,7 @@ def find_fixme(options): ...@@ -27,13 +47,7 @@ def find_fixme(options):
# This makes the folder if it doesn't already exist. # This makes the folder if it doesn't already exist.
report_dir = (Env.REPORT_DIR / system).makedirs_p() report_dir = (Env.REPORT_DIR / system).makedirs_p()
apps = [system] apps_list = ' '.join(top_python_dirs(system))
for directory in ['djangoapps', 'lib']:
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_list = ' '.join(apps)
pythonpath_prefix = ( pythonpath_prefix = (
"PYTHONPATH={system}:{system}/lib" "PYTHONPATH={system}:{system}/lib"
...@@ -88,13 +102,7 @@ def run_pylint(options): ...@@ -88,13 +102,7 @@ def run_pylint(options):
if errors: if errors:
flags.append("--errors-only") flags.append("--errors-only")
apps = [system] apps_list = ' '.join(top_python_dirs(system))
for directory in ['lib']:
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_list = ' '.join(apps)
pythonpath_prefix = ( pythonpath_prefix = (
"PYTHONPATH={system}:{system}/djangoapps:{system}/" "PYTHONPATH={system}:{system}/djangoapps:{system}/"
......
...@@ -61,7 +61,7 @@ git clean -qxfd ...@@ -61,7 +61,7 @@ git clean -qxfd
source scripts/jenkins-common.sh source scripts/jenkins-common.sh
# Violations thresholds for failing the build # Violations thresholds for failing the build
PYLINT_THRESHOLD=6400 PYLINT_THRESHOLD=7350
# If the environment variable 'SHARD' is not set, default to 'all'. # If the environment variable 'SHARD' is not set, default to 'all'.
# This could happen if you are trying to use this script from # This could happen if you are trying to use this script from
......
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