From 8556d670a27ed0ba2713aa31bb7bcef27497b93f Mon Sep 17 00:00:00 2001 From: usamasadiq Date: Tue, 2 Feb 2021 15:29:41 +0500 Subject: [PATCH] Applied pylint-amnesty --- cms/__init__.py | 2 +- cms/celery.py | 2 +- cms/conftest.py | 2 +- cms/envs/devstack.py | 4 ++-- cms/envs/devstack_decentralized.py | 2 +- cms/envs/devstack_optimized.py | 2 +- cms/envs/devstack_with_worker.py | 2 +- cms/envs/production.py | 8 ++++---- cms/envs/test.py | 2 +- cms/lib/xblock/field_data.py | 2 +- cms/lib/xblock/tagging/tagging.py | 2 +- cms/lib/xblock/tagging/test.py | 8 ++++---- cms/lib/xblock/test/test_authoring_mixin.py | 6 +++--- cms/lib/xblock/test/test_runtime.py | 2 +- cms/wsgi.py | 8 ++++---- 15 files changed, 27 insertions(+), 27 deletions(-) diff --git a/cms/__init__.py b/cms/__init__.py index e022c752ac..f9ed0bb3ce 100644 --- a/cms/__init__.py +++ b/cms/__init__.py @@ -21,4 +21,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 CMS. -from .celery import APP as CELERY_APP +from .celery import APP as CELERY_APP # lint-amnesty, pylint: disable=wrong-import-position diff --git a/cms/celery.py b/cms/celery.py index 293121bcf2..15d1e0beb0 100644 --- a/cms/celery.py +++ b/cms/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/cms/conftest.py b/cms/conftest.py index f66b4c4f54..ca29e3fb5f 100644 --- a/cms/conftest.py +++ b/cms/conftest.py @@ -53,7 +53,7 @@ def _django_clear_site_cache(): clearing mechanism actually works. So override this fixture to not mess with what has been working for us so far. """ - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass @pytest.fixture(autouse=True) diff --git a/cms/envs/devstack.py b/cms/envs/devstack.py index cf538ec1a7..5e371e6315 100644 --- a/cms/envs/devstack.py +++ b/cms/envs/devstack.py @@ -107,7 +107,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.studio:') or hostname.startswith('studio.devstack.edx:'): @@ -195,7 +195,7 @@ JWT_AUTH.update({ ), }) -# pylint: enable=unicode-format-string +# pylint: enable=unicode-format-string # lint-amnesty, pylint: disable=bad-option-value IDA_LOGOUT_URI_LIST = [ 'http://localhost:18130/logout/', # ecommerce diff --git a/cms/envs/devstack_decentralized.py b/cms/envs/devstack_decentralized.py index 40f1d01799..48c8937a4e 100644 --- a/cms/envs/devstack_decentralized.py +++ b/cms/envs/devstack_decentralized.py @@ -150,7 +150,7 @@ JWT_AUTH.update({ ), }) -# pylint: enable=unicode-format-string +# pylint: enable=unicode-format-string # lint-amnesty, pylint: disable=bad-option-value IDA_LOGOUT_URI_LIST = [ 'http://localhost:18130/logout/', # ecommerce diff --git a/cms/envs/devstack_optimized.py b/cms/envs/devstack_optimized.py index d869e53620..d81ef1502f 100644 --- a/cms/envs/devstack_optimized.py +++ b/cms/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/cms/envs/devstack_with_worker.py b/cms/envs/devstack_with_worker.py index 1265492b71..193c2a8075 100644 --- a/cms/envs/devstack_with_worker.py +++ b/cms/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/cms/envs/production.py b/cms/envs/production.py index c07b0c9ddd..818395b707 100644 --- a/cms/envs/production.py +++ b/cms/envs/production.py @@ -22,9 +22,9 @@ from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType from .common import * -from openedx.core.lib.derived import derive_settings -from openedx.core.lib.logsettings import get_logger_config -from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed +from openedx.core.lib.derived import derive_settings # lint-amnesty, pylint: disable=wrong-import-order +from openedx.core.lib.logsettings import get_logger_config # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed # lint-amnesty, pylint: disable=wrong-import-order def get_env_setting(setting): @@ -33,7 +33,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 ################################ diff --git a/cms/envs/test.py b/cms/envs/test.py index 5cc0f0f005..9d99251684 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -75,7 +75,7 @@ COMMON_TEST_DATA_ROOT = COMMON_ROOT / "test" / "data" FEATURES['ENABLE_EXPORT_GIT'] = True GIT_REPO_EXPORT_DIR = TEST_ROOT / "export_course_repos" -# TODO (cpennington): We need to figure out how envs/test.py can inject things into common.py so that we don't have to repeat this sort of thing +# TODO (cpennington): We need to figure out how envs/test.py can inject things into common.py so that we don't have to repeat this sort of thing # lint-amnesty, pylint: disable=line-too-long STATICFILES_DIRS = [ COMMON_ROOT / "static", PROJECT_ROOT / "static", diff --git a/cms/lib/xblock/field_data.py b/cms/lib/xblock/field_data.py index dc687e257e..d00425d613 100644 --- a/cms/lib/xblock/field_data.py +++ b/cms/lib/xblock/field_data.py @@ -21,7 +21,7 @@ class CmsFieldData(SplitFieldData): self._authored_data = authored_data self._student_data = student_data - super(CmsFieldData, self).__init__({ + super(CmsFieldData, self).__init__({ # lint-amnesty, pylint: disable=super-with-arguments Scope.content: authored_data, Scope.settings: authored_data, Scope.parent: authored_data, diff --git a/cms/lib/xblock/tagging/tagging.py b/cms/lib/xblock/tagging/tagging.py index 067e4ac510..d5da37ee7d 100644 --- a/cms/lib/xblock/tagging/tagging.py +++ b/cms/lib/xblock/tagging/tagging.py @@ -77,7 +77,7 @@ class StructuredTagsAside(XBlockAside): return Fragment(u'') @XBlock.handler - def save_tags(self, request=None, suffix=None): + def save_tags(self, request=None, suffix=None): # lint-amnesty, pylint: disable=unused-argument """ Handler to save choosen tags with connected XBlock """ diff --git a/cms/lib/xblock/tagging/test.py b/cms/lib/xblock/tagging/test.py index 41e8277dc7..685b0440eb 100644 --- a/cms/lib/xblock/tagging/test.py +++ b/cms/lib/xblock/tagging/test.py @@ -39,7 +39,7 @@ class StructuredTagsAsideTestCase(ModuleStoreTestCase): """ Preparation for the test execution """ - super(StructuredTagsAsideTestCase, self).setUp() + super(StructuredTagsAsideTestCase, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.aside_name = 'tagging_aside' self.aside_tag_dif = 'difficulty' self.aside_tag_dif_value = 'Hard' @@ -113,7 +113,7 @@ class StructuredTagsAsideTestCase(ModuleStoreTestCase): def tearDown(self): TagAvailableValues.objects.all().delete() TagCategories.objects.all().delete() - super(StructuredTagsAsideTestCase, self).tearDown() + super(StructuredTagsAsideTestCase, self).tearDown() # lint-amnesty, pylint: disable=super-with-arguments def test_aside_contains_tags(self): """ @@ -181,11 +181,11 @@ class StructuredTagsAsideTestCase(ModuleStoreTestCase): self.assertEqual(option_values2, ['Learned a few things', 'Learned everything', 'Learned nothing']) # Now ensure the acid_aside is not in the result - self.assertNotRegexpMatches(problem_html, r"data-block-type=[\"\']acid_aside[\"\']") + self.assertNotRegexpMatches(problem_html, r"data-block-type=[\"\']acid_aside[\"\']") # lint-amnesty, pylint: disable=deprecated-method # Ensure about video don't have asides video_html = get_preview_fragment(request, self.video, context).content - self.assertNotRegexpMatches(video_html, "