diff --git a/lms/__init__.py b/lms/__init__.py index 2481eb2689..b2e36bfc94 100644 --- a/lms/__init__.py +++ b/lms/__init__.py @@ -1,4 +1,4 @@ -""" +""" # lint-amnesty, pylint: disable=django-not-configured Celery needs to be loaded when the cms modules are so that task registration and discovery can work correctly. """ @@ -17,4 +17,4 @@ kombu.utils.entrypoints = lambda namespace: iter([]) # This will make sure the app is always imported when Django starts so # that shared_task will use this app, and also ensures that the celery # singleton is always configured for the LMS. -from .celery import APP as CELERY_APP +from .celery import APP as CELERY_APP # lint-amnesty, pylint: disable=wrong-import-position diff --git a/lms/celery.py b/lms/celery.py index 808df030ef..2e7235f8d5 100644 --- a/lms/celery.py +++ b/lms/celery.py @@ -1,4 +1,4 @@ -""" +""" # lint-amnesty, pylint: disable=django-not-configured Import celery, load its settings from the django settings and auto discover tasks in all installed django apps. diff --git a/lms/docker_lms_gunicorn.py b/lms/docker_lms_gunicorn.py index 163e13be33..9b79a792a1 100644 --- a/lms/docker_lms_gunicorn.py +++ b/lms/docker_lms_gunicorn.py @@ -1,4 +1,4 @@ -""" +""" # lint-amnesty, pylint: disable=django-not-configured gunicorn configuration file: http://docs.gunicorn.org/en/stable/configure.html """ diff --git a/lms/envs/devstack.py b/lms/envs/devstack.py index a7bd7f0f98..919ed49376 100644 --- a/lms/envs/devstack.py +++ b/lms/envs/devstack.py @@ -9,7 +9,7 @@ from os.path import abspath, dirname, join from corsheaders.defaults import default_headers as corsheaders_default_headers -# pylint: enable=unicode-format-string +# pylint: enable=unicode-format-string # lint-amnesty, pylint: disable=bad-option-value ##################################################################### from edx_django_utils.plugins import add_plugins @@ -105,7 +105,7 @@ DEBUG_TOOLBAR_CONFIG = { } -def should_show_debug_toolbar(request): +def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing-function-docstring # We always want the toolbar on devstack unless running tests from another Docker container hostname = request.get_host() if hostname.startswith('edx.devstack.lms:') or hostname.startswith('lms.devstack.edx:'): @@ -174,7 +174,7 @@ FEATURES['CERTIFICATES_HTML_VIEW'] = True ########################## Course Discovery ####################### -LANGUAGE_MAP = {'terms': {lang: display for lang, display in ALL_LANGUAGES}, 'name': 'Language'} +LANGUAGE_MAP = {'terms': {lang: display for lang, display in ALL_LANGUAGES}, 'name': 'Language'} # lint-amnesty, pylint: disable=unnecessary-comprehension COURSE_DISCOVERY_MEANINGS = { 'org': { 'name': 'Organization', diff --git a/lms/envs/devstack_decentralized.py b/lms/envs/devstack_decentralized.py index a622aeae7f..f288787b1a 100644 --- a/lms/envs/devstack_decentralized.py +++ b/lms/envs/devstack_decentralized.py @@ -8,7 +8,7 @@ from os.path import abspath, dirname, join from corsheaders.defaults import default_headers as corsheaders_default_headers -# pylint: enable=unicode-format-string +# pylint: enable=unicode-format-string # lint-amnesty, pylint: disable=bad-option-value ##################################################################### from edx_django_utils.plugins import add_plugins @@ -139,7 +139,7 @@ FEATURES['CERTIFICATES_HTML_VIEW'] = True ########################## Course Discovery ####################### -LANGUAGE_MAP = {'terms': {lang: display for lang, display in ALL_LANGUAGES}, 'name': 'Language'} +LANGUAGE_MAP = {'terms': {lang: display for lang, display in ALL_LANGUAGES}, 'name': 'Language'} # lint-amnesty, pylint: disable=unnecessary-comprehension COURSE_DISCOVERY_MEANINGS = { 'org': { 'name': 'Organization', diff --git a/lms/envs/devstack_optimized.py b/lms/envs/devstack_optimized.py index 40c98f22dc..b8d7cceea3 100644 --- a/lms/envs/devstack_optimized.py +++ b/lms/envs/devstack_optimized.py @@ -19,7 +19,7 @@ invoked each time that changes have been made. """ -import os +import os # lint-amnesty, pylint: disable=unused-import ########################## Devstack settings ################################### diff --git a/lms/envs/devstack_with_worker.py b/lms/envs/devstack_with_worker.py index 4844a188ee..3596852757 100644 --- a/lms/envs/devstack_with_worker.py +++ b/lms/envs/devstack_with_worker.py @@ -12,7 +12,7 @@ In two separate processes on devstack: """ -import os +import os # lint-amnesty, pylint: disable=unused-import # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files diff --git a/lms/envs/production.py b/lms/envs/production.py index 8a55e2a29d..f0b3ed5635 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -44,7 +44,7 @@ def get_env_setting(setting): return os.environ[setting] except KeyError: error_msg = u"Set the %s env variable" % setting - raise ImproperlyConfigured(error_msg) + raise ImproperlyConfigured(error_msg) # lint-amnesty, pylint: disable=raise-missing-from ################################ ALWAYS THE SAME ############################## @@ -189,7 +189,7 @@ SESSION_COOKIE_DOMAIN = ENV_TOKENS.get('SESSION_COOKIE_DOMAIN') SESSION_COOKIE_HTTPONLY = ENV_TOKENS.get('SESSION_COOKIE_HTTPONLY', True) DCS_SESSION_COOKIE_SAMESITE = ENV_TOKENS.get('DCS_SESSION_COOKIE_SAMESITE', DCS_SESSION_COOKIE_SAMESITE) -DCS_SESSION_COOKIE_SAMESITE_FORCE_ALL = ENV_TOKENS.get('DCS_SESSION_COOKIE_SAMESITE_FORCE_ALL', DCS_SESSION_COOKIE_SAMESITE_FORCE_ALL) +DCS_SESSION_COOKIE_SAMESITE_FORCE_ALL = ENV_TOKENS.get('DCS_SESSION_COOKIE_SAMESITE_FORCE_ALL', DCS_SESSION_COOKIE_SAMESITE_FORCE_ALL) # lint-amnesty, pylint: disable=line-too-long AWS_SES_REGION_NAME = ENV_TOKENS.get('AWS_SES_REGION_NAME', 'us-east-1') AWS_SES_REGION_ENDPOINT = ENV_TOKENS.get('AWS_SES_REGION_ENDPOINT', 'email.us-east-1.amazonaws.com') diff --git a/lms/envs/test.py b/lms/envs/test.py index cd5431bda2..1d2924c6e1 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -17,15 +17,15 @@ sessions. Assumes structure: import logging import os from collections import OrderedDict -from random import choice -from string import digits, ascii_letters, punctuation +from random import choice # lint-amnesty, pylint: disable=unused-import +from string import digits, ascii_letters, punctuation # lint-amnesty, pylint: disable=unused-import from uuid import uuid4 import openid.oidutil from django.utils.translation import ugettext_lazy from edx_django_utils.plugins import add_plugins from path import Path as path -from six.moves import range +from six.moves import range # lint-amnesty, pylint: disable=unused-import from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType from openedx.core.lib.derived import derive_settings @@ -535,7 +535,7 @@ JWT_AUTH.update({ ': "RSA"}' ), }) -# pylint: enable=unicode-format-string +# pylint: enable=unicode-format-string # lint-amnesty, pylint: disable=bad-option-value ####################### Plugin Settings ########################## add_plugins(__name__, ProjectType.LMS, SettingsType.TEST) diff --git a/lms/lib/courseware_search/lms_filter_generator.py b/lms/lib/courseware_search/lms_filter_generator.py index e3cec0f559..b517c24f42 100644 --- a/lms/lib/courseware_search/lms_filter_generator.py +++ b/lms/lib/courseware_search/lms_filter_generator.py @@ -29,7 +29,7 @@ class LmsSearchFilterGenerator(SearchFilterGenerator): def field_dictionary(self, **kwargs): """ add course if provided otherwise add courses in which the user is enrolled in """ - field_dictionary = super(LmsSearchFilterGenerator, self).field_dictionary(**kwargs) + field_dictionary = super(LmsSearchFilterGenerator, self).field_dictionary(**kwargs) # lint-amnesty, pylint: disable=super-with-arguments if not kwargs.get('user'): field_dictionary['course'] = [] elif not kwargs.get('course_id'): @@ -47,7 +47,7 @@ class LmsSearchFilterGenerator(SearchFilterGenerator): """ Exclude any courses defined outside the current org. """ - exclude_dictionary = super(LmsSearchFilterGenerator, self).exclude_dictionary(**kwargs) + exclude_dictionary = super(LmsSearchFilterGenerator, self).exclude_dictionary(**kwargs) # lint-amnesty, pylint: disable=super-with-arguments course_org_filter = configuration_helpers.get_current_site_orgs() # If we have a course filter we are ensuring that we only get those courses above if not course_org_filter: diff --git a/lms/lib/courseware_search/test/test_lms_filter_generator.py b/lms/lib/courseware_search/test/test_lms_filter_generator.py index ea16908892..255b23c927 100644 --- a/lms/lib/courseware_search/test/test_lms_filter_generator.py +++ b/lms/lib/courseware_search/test/test_lms_filter_generator.py @@ -52,7 +52,7 @@ class LmsSearchFilterGeneratorTestCase(ModuleStoreTestCase): ) def setUp(self): - super(LmsSearchFilterGeneratorTestCase, self).setUp() + super(LmsSearchFilterGeneratorTestCase, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.build_courses() self.user = UserFactory.create(username="jack", email="jack@fake.edx.org", password='test') diff --git a/lms/lib/courseware_search/test/test_lms_result_processor.py b/lms/lib/courseware_search/test/test_lms_result_processor.py index 2bfed8f2b9..afe16e2064 100644 --- a/lms/lib/courseware_search/test/test_lms_result_processor.py +++ b/lms/lib/courseware_search/test/test_lms_result_processor.py @@ -63,7 +63,7 @@ class LmsSearchResultProcessorTestCase(ModuleStoreTestCase): ) def setUp(self): - super(LmsSearchResultProcessorTestCase, self).setUp() + super(LmsSearchResultProcessorTestCase, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.build_course() def test_url_parameter(self): diff --git a/lms/lib/xblock/test/test_mixin.py b/lms/lib/xblock/test/test_mixin.py index 34034851a3..c1bd13392f 100644 --- a/lms/lib/xblock/test/test_mixin.py +++ b/lms/lib/xblock/test/test_mixin.py @@ -70,7 +70,7 @@ class XBlockValidationTest(LmsXBlockMixinTestCase): Unit tests for XBlock validation """ def setUp(self): - super(XBlockValidationTest, self).setUp() + super(XBlockValidationTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.build_course() def verify_validation_message(self, message, expected_message, expected_message_type): @@ -280,7 +280,7 @@ class OpenAssessmentBlockMixinTestCase(ModuleStoreTestCase): """ def setUp(self): - super(OpenAssessmentBlockMixinTestCase, self).setUp() + super(OpenAssessmentBlockMixinTestCase, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.course = CourseFactory.create() self.section = ItemFactory.create(parent=self.course, category='chapter', display_name='Test Section') self.open_assessment = ItemFactory.create( @@ -376,7 +376,7 @@ class RenamedTuple(tuple): This class is only used to allow overriding __name__ on the tuples passed through ddt, in order to have the generated test names make sense. """ - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass def ddt_named(parent, child): @@ -412,7 +412,7 @@ class XBlockMergedGroupAccessTest(LmsXBlockMixinTestCase): ) def setUp(self): - super(XBlockMergedGroupAccessTest, self).setUp() + super(XBlockMergedGroupAccessTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.build_course() def verify_group_access(self, block_location, expected_dict): diff --git a/lms/startup.py b/lms/startup.py index ed1ad1caba..e430d4cbc6 100644 --- a/lms/startup.py +++ b/lms/startup.py @@ -1,4 +1,4 @@ -""" +""" # lint-amnesty, pylint: disable=django-not-configured Module for code that should run during LMS startup (deprecated) """ diff --git a/lms/tests.py b/lms/tests.py index b90707bafd..7b63055034 100644 --- a/lms/tests.py +++ b/lms/tests.py @@ -1,10 +1,10 @@ -"""Tests for the lms module itself.""" +"""Tests for the lms module itself.""" # lint-amnesty, pylint: disable=django-not-configured import logging import mimetypes -from django.conf import settings +from django.conf import settings # lint-amnesty, pylint: disable=unused-import from django.test import TestCase log = logging.getLogger(__name__) diff --git a/lms/urls.py b/lms/urls.py index b416f3d573..24c6e204b8 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -1,4 +1,4 @@ -""" +""" # lint-amnesty, pylint: disable=django-not-configured URLs for LMS """ diff --git a/lms/wsgi.py b/lms/wsgi.py index 2893066edd..5fc9188f63 100644 --- a/lms/wsgi.py +++ b/lms/wsgi.py @@ -1,4 +1,4 @@ -""" +""" # lint-amnesty, pylint: disable=django-not-configured WSGI config for LMS. This module contains the WSGI application used by Django's development server @@ -13,16 +13,16 @@ from safe_lxml import defuse_xml_libs defuse_xml_libs() # Disable PyContract contract checking when running as a webserver -import contracts +import contracts # lint-amnesty, pylint: disable=wrong-import-order, wrong-import-position contracts.disable_all() -import os +import os # lint-amnesty, pylint: disable=wrong-import-order, wrong-import-position os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lms.envs.aws") -import lms.startup as startup +import lms.startup as startup # lint-amnesty, pylint: disable=wrong-import-position startup.run() -from xmodule.modulestore.django import modulestore +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-position # Trigger a forced initialization of our modulestores since this can take a # while to complete and we want this done before HTTP requests are accepted. @@ -31,5 +31,5 @@ modulestore() # This application object is used by the development server # as well as any WSGI server configured to use this file. -from django.core.wsgi import get_wsgi_application +from django.core.wsgi import get_wsgi_application # lint-amnesty, pylint: disable=wrong-import-order, wrong-import-position application = get_wsgi_application() diff --git a/lms/wsgi_apache_lms.py b/lms/wsgi_apache_lms.py index 09c038ada8..00eaac9bb0 100644 --- a/lms/wsgi_apache_lms.py +++ b/lms/wsgi_apache_lms.py @@ -1,4 +1,4 @@ -""" +""" # lint-amnesty, pylint: disable=django-not-configured Apache WSGI file for LMS This module contains the WSGI application used for Apache deployment. @@ -9,15 +9,15 @@ It exposes a module-level variable named ``application``. from safe_lxml import defuse_xml_libs defuse_xml_libs() -import os +import os # lint-amnesty, pylint: disable=wrong-import-order, wrong-import-position os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lms.envs.aws") os.environ.setdefault("SERVICE_VARIANT", "lms") -import lms.startup as startup +import lms.startup as startup # lint-amnesty, pylint: disable=wrong-import-position startup.run() # This application object is used by the development server # as well as any WSGI server configured to use this file. -from django.core.wsgi import get_wsgi_application +from django.core.wsgi import get_wsgi_application # lint-amnesty, pylint: disable=wrong-import-order, wrong-import-position application = get_wsgi_application() # pylint: disable=invalid-name