From 1175838fa5ef1d03e9ca24b9a4af45361b863094 Mon Sep 17 00:00:00 2001 From: usamasadiq Date: Thu, 4 Feb 2021 17:27:19 +0500 Subject: [PATCH] fix pep8 warnings --- common/lib/capa/capa/correctmap.py | 5 +++-- common/lib/capa/capa/tests/response_xml_factory.py | 2 +- common/lib/capa/capa/tests/test_capa_problem.py | 3 ++- common/lib/capa/capa/tests/test_customrender.py | 2 +- common/lib/capa/capa/xqueue_interface.py | 2 +- common/lib/capa/setup.py | 2 +- common/lib/sandbox-packages/setup.py | 2 +- .../verifiers/tests_draganddrop.py | 2 +- common/lib/symmath/setup.py | 2 +- common/lib/symmath/symmath/symmath_check.py | 3 ++- common/lib/symmath/symmath/test_symmath_check.py | 2 +- common/lib/xmodule/setup.py | 2 +- common/lib/xmodule/xmodule/annotatable_module.py | 2 +- common/lib/xmodule/xmodule/contentstore/content.py | 2 +- common/lib/xmodule/xmodule/contentstore/django.py | 2 +- common/lib/xmodule/xmodule/contentstore/mongo.py | 2 +- common/lib/xmodule/xmodule/contentstore/utils.py | 2 +- common/lib/xmodule/xmodule/exceptions.py | 3 ++- common/lib/xmodule/xmodule/fields.py | 2 +- common/lib/xmodule/xmodule/html_checker.py | 2 +- common/lib/xmodule/xmodule/html_module.py | 2 +- common/lib/xmodule/xmodule/modulestore/__init__.py | 14 ++++++-------- .../lib/xmodule/xmodule/modulestore/mongo/base.py | 4 ++-- .../split_mongo/caching_descriptor_system.py | 2 +- .../split_mongo/definition_lazy_loader.py | 2 +- .../xmodule/modulestore/split_mongo/split.py | 4 ++-- .../modulestore/split_mongo/split_mongo_kvs.py | 2 +- .../xmodule/xmodule/modulestore/store_utilities.py | 2 +- .../xmodule/modulestore/tests/test_assetstore.py | 4 ---- .../xmodule/modulestore/tests/test_mongo.py | 1 - .../xmodule/modulestore/tests/test_publish.py | 1 - .../modulestore/tests/test_split_modulestore.py | 2 +- .../modulestore/tests/test_split_w_old_mongo.py | 2 +- .../xmodule/modulestore/tests/test_xml_importer.py | 2 +- common/lib/xmodule/xmodule/modulestore/xml.py | 2 +- common/lib/xmodule/xmodule/mongo_utils.py | 1 - common/lib/xmodule/xmodule/randomize_module.py | 2 +- common/lib/xmodule/xmodule/raw_module.py | 3 ++- common/lib/xmodule/xmodule/stringify.py | 4 ++-- .../lib/xmodule/xmodule/tests/test_conditional.py | 2 +- .../lib/xmodule/xmodule/tests/test_html_module.py | 2 +- common/lib/xmodule/xmodule/tests/test_import.py | 3 ++- common/lib/xmodule/xmodule/timeinfo.py | 2 +- common/lib/xmodule/xmodule/util/sandboxing.py | 2 +- common/lib/xmodule/xmodule/wrapper_module.py | 3 ++- common/lib/xmodule/xmodule/x_module.py | 3 +-- common/lib/xmodule/xmodule/xml_module.py | 2 +- lms/djangoapps/courseware/model_data.py | 2 +- .../instructor/views/instructor_dashboard.py | 2 +- lms/lib/xblock/test/test_mixin.py | 2 +- pylintrc | 1 + 51 files changed, 63 insertions(+), 65 deletions(-) diff --git a/common/lib/capa/capa/correctmap.py b/common/lib/capa/capa/correctmap.py index 07ae3f9659..7f0745c521 100644 --- a/common/lib/capa/capa/correctmap.py +++ b/common/lib/capa/capa/correctmap.py @@ -1,4 +1,5 @@ -# ----------------------------------------------------------------------------- # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring +# ----------------------------------------------------------------------------- # class used to store graded responses to CAPA questions # # Used by responsetypes and capa_problem @@ -47,7 +48,7 @@ class CorrectMap(object): hint='', hintmode=None, queuestate=None, - answervariable=None, # lint-amnesty, pylint: disable=C0330, bad-option-value + answervariable=None, **kwargs ): diff --git a/common/lib/capa/capa/tests/response_xml_factory.py b/common/lib/capa/capa/tests/response_xml_factory.py index d39d2bb1c7..1b3c587746 100644 --- a/common/lib/capa/capa/tests/response_xml_factory.py +++ b/common/lib/capa/capa/tests/response_xml_factory.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring from abc import ABCMeta, abstractmethod diff --git a/common/lib/capa/capa/tests/test_capa_problem.py b/common/lib/capa/capa/tests/test_capa_problem.py index 2b688652ef..4c3beea499 100644 --- a/common/lib/capa/capa/tests/test_capa_problem.py +++ b/common/lib/capa/capa/tests/test_capa_problem.py @@ -212,7 +212,8 @@ class CAPAProblemTest(unittest.TestCase): Verify that tag with question text is not removed when inputtype is not fully accessible. """ question = "Click the country which is home to the Pyramids." - xml = """ # lint-amnesty, pylint: disable=duplicate-string-formatting-argument + # lint-amnesty, pylint: disable=duplicate-string-formatting-argument + xml = """

{}

diff --git a/common/lib/capa/capa/tests/test_customrender.py b/common/lib/capa/capa/tests/test_customrender.py index ed4c5f7c54..b0c89a68eb 100644 --- a/common/lib/capa/capa/tests/test_customrender.py +++ b/common/lib/capa/capa/tests/test_customrender.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import unittest import xml.sax.saxutils as saxutils diff --git a/common/lib/capa/capa/xqueue_interface.py b/common/lib/capa/capa/xqueue_interface.py index 7dcda7ca5a..99bcaa8d07 100644 --- a/common/lib/capa/capa/xqueue_interface.py +++ b/common/lib/capa/capa/xqueue_interface.py @@ -1,4 +1,4 @@ -# # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring # LMS Interface to external queueing system (xqueue) # diff --git a/common/lib/capa/setup.py b/common/lib/capa/setup.py index c284b9b056..4ec7866f31 100644 --- a/common/lib/capa/setup.py +++ b/common/lib/capa/setup.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=django-not-configured, missing-module-docstring +# lint-amnesty, pylint: disable=django-not-configured, missing-module-docstring from setuptools import find_packages, setup diff --git a/common/lib/sandbox-packages/setup.py b/common/lib/sandbox-packages/setup.py index a5f85d59ff..3a02c854bc 100644 --- a/common/lib/sandbox-packages/setup.py +++ b/common/lib/sandbox-packages/setup.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring from setuptools import setup diff --git a/common/lib/sandbox-packages/verifiers/tests_draganddrop.py b/common/lib/sandbox-packages/verifiers/tests_draganddrop.py index a25a3125b1..9c5e544e28 100644 --- a/common/lib/sandbox-packages/verifiers/tests_draganddrop.py +++ b/common/lib/sandbox-packages/verifiers/tests_draganddrop.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import json import unittest diff --git a/common/lib/symmath/setup.py b/common/lib/symmath/setup.py index d4dd2cc074..0ea41b5056 100644 --- a/common/lib/symmath/setup.py +++ b/common/lib/symmath/setup.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=django-not-configured, missing-module-docstring +# lint-amnesty, pylint: disable=django-not-configured, missing-module-docstring from setuptools import setup setup( diff --git a/common/lib/symmath/symmath/symmath_check.py b/common/lib/symmath/symmath/symmath_check.py index 6ac03a47d2..5e32527858 100644 --- a/common/lib/symmath/symmath/symmath_check.py +++ b/common/lib/symmath/symmath/symmath_check.py @@ -1,4 +1,5 @@ -#!/usr/bin/python # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring +# !/usr/bin/python # -*- coding: utf-8 -*- # # File: symmath_check.py diff --git a/common/lib/symmath/symmath/test_symmath_check.py b/common/lib/symmath/symmath/test_symmath_check.py index 502f2c8be6..0271f42ecc 100644 --- a/common/lib/symmath/symmath/test_symmath_check.py +++ b/common/lib/symmath/symmath/test_symmath_check.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring from unittest import TestCase from six.moves import range diff --git a/common/lib/xmodule/setup.py b/common/lib/xmodule/setup.py index 5b2329c3ab..144ec4c390 100644 --- a/common/lib/xmodule/setup.py +++ b/common/lib/xmodule/setup.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=django-not-configured, missing-module-docstring +# lint-amnesty, pylint: disable=django-not-configured, missing-module-docstring from setuptools import find_packages, setup diff --git a/common/lib/xmodule/xmodule/annotatable_module.py b/common/lib/xmodule/xmodule/annotatable_module.py index e657bd3435..3d376eb220 100644 --- a/common/lib/xmodule/xmodule/annotatable_module.py +++ b/common/lib/xmodule/xmodule/annotatable_module.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import logging import textwrap diff --git a/common/lib/xmodule/xmodule/contentstore/content.py b/common/lib/xmodule/xmodule/contentstore/content.py index 3486743027..f5cdc1a631 100644 --- a/common/lib/xmodule/xmodule/contentstore/content.py +++ b/common/lib/xmodule/xmodule/contentstore/content.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import logging import os diff --git a/common/lib/xmodule/xmodule/contentstore/django.py b/common/lib/xmodule/xmodule/contentstore/django.py index 186524da41..2d375c70dd 100644 --- a/common/lib/xmodule/xmodule/contentstore/django.py +++ b/common/lib/xmodule/xmodule/contentstore/django.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring from importlib import import_module diff --git a/common/lib/xmodule/xmodule/contentstore/mongo.py b/common/lib/xmodule/xmodule/contentstore/mongo.py index 754bde44e1..4888a31ce6 100644 --- a/common/lib/xmodule/xmodule/contentstore/mongo.py +++ b/common/lib/xmodule/xmodule/contentstore/mongo.py @@ -28,7 +28,7 @@ class MongoContentStore(ContentStore): """ MongoDB-backed ContentStore. """ - # lint-amnesty, pylint: disable=bad-continuation, bad-option-value, unused-argument + # lint-amnesty, pylint: disable=unused-argument def __init__( self, host, db, port=27017, tz_aware=True, user=None, password=None, bucket='fs', collection=None, **kwargs diff --git a/common/lib/xmodule/xmodule/contentstore/utils.py b/common/lib/xmodule/xmodule/contentstore/utils.py index 181c7afe40..1a9b91a951 100644 --- a/common/lib/xmodule/xmodule/contentstore/utils.py +++ b/common/lib/xmodule/xmodule/contentstore/utils.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring from xmodule.contentstore.content import StaticContent diff --git a/common/lib/xmodule/xmodule/exceptions.py b/common/lib/xmodule/xmodule/exceptions.py index 2e7954d9b3..c813dabaf9 100644 --- a/common/lib/xmodule/xmodule/exceptions.py +++ b/common/lib/xmodule/xmodule/exceptions.py @@ -1,4 +1,5 @@ -class InvalidDefinitionError(Exception): # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring +class InvalidDefinitionError(Exception): pass diff --git a/common/lib/xmodule/xmodule/fields.py b/common/lib/xmodule/xmodule/fields.py index 7babfd695f..49504bdf2c 100644 --- a/common/lib/xmodule/xmodule/fields.py +++ b/common/lib/xmodule/xmodule/fields.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import datetime import logging diff --git a/common/lib/xmodule/xmodule/html_checker.py b/common/lib/xmodule/xmodule/html_checker.py index 6faf512fb4..d97499d0f0 100644 --- a/common/lib/xmodule/xmodule/html_checker.py +++ b/common/lib/xmodule/xmodule/html_checker.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring from lxml import etree diff --git a/common/lib/xmodule/xmodule/html_module.py b/common/lib/xmodule/xmodule/html_module.py index dcca75c8b4..4489c79330 100644 --- a/common/lib/xmodule/xmodule/html_module.py +++ b/common/lib/xmodule/xmodule/html_module.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import copy import logging diff --git a/common/lib/xmodule/xmodule/modulestore/__init__.py b/common/lib/xmodule/xmodule/modulestore/__init__.py index a38a469840..3c071aa708 100644 --- a/common/lib/xmodule/xmodule/modulestore/__init__.py +++ b/common/lib/xmodule/xmodule/modulestore/__init__.py @@ -387,7 +387,6 @@ class EditInfo(object): self.original_usage_version = edit_info.get('original_usage_version', None) def __repr__(self): - # lint-amnesty, pylint: disable=bad-continuation, bad-option-value return ("{classname}(previous_version={self.previous_version}, " "update_version={self.update_version}, " "source_version={source_version}, " @@ -400,7 +399,7 @@ class EditInfo(object): self=self, classname=self.__class__.__name__, source_version="UNSET" if self.source_version is None else self.source_version, - ) # lint-amnesty, pylint: disable=bad-continuation, bad-option-value + ) def __eq__(self, edit_info): """ @@ -474,7 +473,6 @@ class BlockData(object): return self.asides def __repr__(self): - # lint-amnesty, pylint: disable=bad-continuation, bad-option-value return ("{classname}(fields={self.fields}, " "block_type={self.block_type}, " "definition={self.definition}, " @@ -485,7 +483,7 @@ class BlockData(object): self=self, classname=self.__class__.__name__, asides=self.get_asides() - ) # lint-amnesty, pylint: disable=bad-continuation, bad-option-value + ) def __eq__(self, block_data): """ @@ -1160,14 +1158,14 @@ class ModuleStoreReadBase(BulkOperationsMixin, ModuleStoreRead): """ Implement interface functionality that can be shared. """ - def __init__( + def __init__( # lint-amnesty, pylint: disable=unused-argument self, contentstore=None, - doc_store_config=None, # ignore if passed up # lint-amnesty, pylint: disable=unused-argument + doc_store_config=None, # ignore if passed up metadata_inheritance_cache_subsystem=None, request_cache=None, - xblock_mixins=(), xblock_select=None, xblock_field_data_wrappers=(), disabled_xblock_types=lambda: [], # lint-amnesty, pylint: disable=bad-continuation, bad-option-value + xblock_mixins=(), xblock_select=None, xblock_field_data_wrappers=(), disabled_xblock_types=lambda: [], # temporary parms to enable backward compatibility. remove once all envs migrated - db=None, collection=None, host=None, port=None, tz_aware=True, user=None, password=None, # lint-amnesty, pylint: disable=unused-argument + db=None, collection=None, host=None, port=None, tz_aware=True, user=None, password=None, # allow lower level init args to pass harmlessly ** kwargs ): diff --git a/common/lib/xmodule/xmodule/modulestore/mongo/base.py b/common/lib/xmodule/xmodule/modulestore/mongo/base.py index 84d08e4028..e7bebd5d55 100644 --- a/common/lib/xmodule/xmodule/modulestore/mongo/base.py +++ b/common/lib/xmodule/xmodule/modulestore/mongo/base.py @@ -1637,8 +1637,8 @@ class MongoModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase, Mongo but does NOT return a version agnostic location. ''' assert location.branch is None - assert revision == ModuleStoreEnum.RevisionOption.published_only \ # lint-amnesty, pylint: disable=consider-using-in - or revision == ModuleStoreEnum.RevisionOption.draft_preferred + assert revision == ModuleStoreEnum.RevisionOption.published_only \ + or revision == ModuleStoreEnum.RevisionOption.draft_preferred # lint-amnesty, pylint: disable=consider-using-in parent_cache = self._get_parent_cache(self.get_branch_setting()) if parent_cache.has(six.text_type(location)): diff --git a/common/lib/xmodule/xmodule/modulestore/split_mongo/caching_descriptor_system.py b/common/lib/xmodule/xmodule/modulestore/split_mongo/caching_descriptor_system.py index 3b11d903aa..1359a59b63 100644 --- a/common/lib/xmodule/xmodule/modulestore/split_mongo/caching_descriptor_system.py +++ b/common/lib/xmodule/xmodule/modulestore/split_mongo/caching_descriptor_system.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import logging import sys diff --git a/common/lib/xmodule/xmodule/modulestore/split_mongo/definition_lazy_loader.py b/common/lib/xmodule/xmodule/modulestore/split_mongo/definition_lazy_loader.py index ff59544721..94c1eca39c 100644 --- a/common/lib/xmodule/xmodule/modulestore/split_mongo/definition_lazy_loader.py +++ b/common/lib/xmodule/xmodule/modulestore/split_mongo/definition_lazy_loader.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import copy diff --git a/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py b/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py index d10494a74a..0b5ba7e894 100644 --- a/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py +++ b/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py @@ -1287,7 +1287,7 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase): Check that the block matches all the criteria """ # do the checks which don't require loading any additional data - if ( # lint-amnesty, pylint: disable=bad-continuation, bad-option-value + if ( self._block_matches(block_data, qualifiers) and self._block_matches(block_data.fields, settings) ): @@ -1337,7 +1337,7 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase): for block_id, value in six.iteritems(course.structure['blocks']): if _block_matches_all(value): if not include_orphans: - if ( # lint-amnesty, pylint: disable=bad-continuation, bad-option-value + if ( block_id.type in DETACHED_XBLOCK_TYPES or self.has_path_to_root(block_id, course, path_cache, parents_cache) ): diff --git a/common/lib/xmodule/xmodule/modulestore/split_mongo/split_mongo_kvs.py b/common/lib/xmodule/xmodule/modulestore/split_mongo/split_mongo_kvs.py index b82d5a6e28..251bee078e 100644 --- a/common/lib/xmodule/xmodule/modulestore/split_mongo/split_mongo_kvs.py +++ b/common/lib/xmodule/xmodule/modulestore/split_mongo/split_mongo_kvs.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import copy from collections import namedtuple diff --git a/common/lib/xmodule/xmodule/modulestore/store_utilities.py b/common/lib/xmodule/xmodule/modulestore/store_utilities.py index ea52d50509..5e97179286 100644 --- a/common/lib/xmodule/xmodule/modulestore/store_utilities.py +++ b/common/lib/xmodule/xmodule/modulestore/store_utilities.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import logging import re diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_assetstore.py b/common/lib/xmodule/xmodule/modulestore/tests/test_assetstore.py index f515f5d69f..41123dd241 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_assetstore.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_assetstore.py @@ -47,7 +47,6 @@ class AssetStoreTestData(object): 'edited_by', 'edited_by_email', 'edited_on', 'created_by', 'created_by_email', 'created_on', 'curr_version', 'prev_version' ) - # lint-amnesty, pylint: disable=bad-continuation, bad-option-value all_asset_data = ( ('pic1.jpg', 'EKMND332DDBK', 'pix/archive', False, user_id_long, user_email, now + timedelta(seconds=10 * 1), user_id_long, user_email, now, '14', '13'), @@ -451,7 +450,6 @@ class TestMongoAssetMetadataStorage(TestCase): """ getting all things which are of type other than 'asset' """ - # lint-amnesty, pylint: disable=bad-continuation, bad-option-value with storebuilder.build() as (__, store): course = CourseFactory.create(modulestore=store) @@ -488,7 +486,6 @@ class TestMongoAssetMetadataStorage(TestCase): """ Save a list of asset metadata all at once. """ - # lint-amnesty, pylint: disable=bad-continuation, bad-option-value with storebuilder.build() as (__, store): course = CourseFactory.create(modulestore=store) @@ -528,7 +525,6 @@ class TestMongoAssetMetadataStorage(TestCase): """ Save a list of asset metadata all at once - but with one asset's metadata from a different course. """ - # lint-amnesty, pylint: disable=bad-continuation, bad-option-value with storebuilder.build() as (__, store): course1 = CourseFactory.create(modulestore=store) course2 = CourseFactory.create(modulestore=store) diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py b/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py index d1c6bd2c73..e61303f6be 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py @@ -13,7 +13,6 @@ import pymongo import pytest import six - # lint-amnesty, pylint: disable=bad-continuation, bad-option-value # pylint: disable=protected-access from django.test import TestCase # pylint: enable=E0611 diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_publish.py b/common/lib/xmodule/xmodule/modulestore/tests/test_publish.py index d7be15c5d3..57e4709326 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_publish.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_publish.py @@ -1024,7 +1024,6 @@ class ElementalDeleteItemTests(DraftPublishedOpBaseTestSetup): # Weirdly, this is a difference between old Mongo -and- old Mongo wrapped with a mixed modulestore. # When the code attempts and fails to delete the draft vertical using the published_only revision, # the draft children are still around in one case and not in the other? Needs investigation. - # lint-amnesty, pylint: disable=bad-continuation, bad-option-value if ( isinstance(modulestore_builder, MongoModulestoreBuilder) and revision == ModuleStoreEnum.RevisionOption.published_only diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py b/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py index cf8991044a..14856a3c00 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py @@ -2266,7 +2266,7 @@ def modulestore(): options.update(SplitModuleTest.MODULESTORE['OPTIONS']) options['render_template'] = render_to_template_mock - # lint-amnesty, pylint: disable=bad-option-value, star-args + # lint-amnesty, pylint: disable=bad-option-value, star-args SplitModuleTest.modulestore = class_( None, # contentstore SplitModuleTest.MODULESTORE['DOC_STORE_CONFIG'], diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_split_w_old_mongo.py b/common/lib/xmodule/xmodule/modulestore/tests/test_split_w_old_mongo.py index b4bb4ba448..e32a517e00 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_split_w_old_mongo.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_split_w_old_mongo.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import datetime import os diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_xml_importer.py b/common/lib/xmodule/xmodule/modulestore/tests/test_xml_importer.py index ce9a8776e7..042c8010d1 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_xml_importer.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_xml_importer.py @@ -95,7 +95,7 @@ def modulestore(): options.update(ModuleStoreNoSettings.MODULESTORE['OPTIONS']) options['render_template'] = render_to_template_mock - # lint-amnesty, pylint: disable=bad-option-value, star-args + # lint-amnesty, pylint: disable=bad-option-value, star-args ModuleStoreNoSettings.modulestore = class_( None, # contentstore ModuleStoreNoSettings.MODULESTORE['DOC_STORE_CONFIG'], diff --git a/common/lib/xmodule/xmodule/modulestore/xml.py b/common/lib/xmodule/xmodule/modulestore/xml.py index 3fce39810f..7befc78f3b 100644 --- a/common/lib/xmodule/xmodule/modulestore/xml.py +++ b/common/lib/xmodule/xmodule/modulestore/xml.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import codecs # lint-amnesty, pylint: disable=unused-import import glob diff --git a/common/lib/xmodule/xmodule/mongo_utils.py b/common/lib/xmodule/xmodule/mongo_utils.py index 97514891e5..93b1a40575 100644 --- a/common/lib/xmodule/xmodule/mongo_utils.py +++ b/common/lib/xmodule/xmodule/mongo_utils.py @@ -21,7 +21,6 @@ logger = logging.getLogger(__name__) # pylint: disable=invalid-name MONGO_READ_PREFERENCE_MAP = dict(zip(_MONGOS_MODES, _MODES)) - # lint-amnesty, pylint: disable=bad-continuation, bad-option-value def connect_to_mongodb( db, host, port=27017, tz_aware=True, user=None, password=None, diff --git a/common/lib/xmodule/xmodule/randomize_module.py b/common/lib/xmodule/xmodule/randomize_module.py index 5ce7e17336..7067b5c13c 100644 --- a/common/lib/xmodule/xmodule/randomize_module.py +++ b/common/lib/xmodule/xmodule/randomize_module.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import logging import random diff --git a/common/lib/xmodule/xmodule/raw_module.py b/common/lib/xmodule/xmodule/raw_module.py index 97b376368f..86ec4a58d8 100644 --- a/common/lib/xmodule/xmodule/raw_module.py +++ b/common/lib/xmodule/xmodule/raw_module.py @@ -1,4 +1,5 @@ -import logging # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring +import logging import re from lxml import etree diff --git a/common/lib/xmodule/xmodule/stringify.py b/common/lib/xmodule/xmodule/stringify.py index d3547e7d99..0ff52846d1 100644 --- a/common/lib/xmodule/xmodule/stringify.py +++ b/common/lib/xmodule/xmodule/stringify.py @@ -1,5 +1,5 @@ -# -*- coding: utf-8 -*- # lint-amnesty, pylint: disable=missing-module-docstring - +# lint-amnesty, pylint: disable=missing-module-docstring +# -*- coding: utf-8 -*- from lxml import etree diff --git a/common/lib/xmodule/xmodule/tests/test_conditional.py b/common/lib/xmodule/xmodule/tests/test_conditional.py index b6a2b172c6..7a4e2d2569 100644 --- a/common/lib/xmodule/xmodule/tests/test_conditional.py +++ b/common/lib/xmodule/xmodule/tests/test_conditional.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import json import unittest diff --git a/common/lib/xmodule/xmodule/tests/test_html_module.py b/common/lib/xmodule/xmodule/tests/test_html_module.py index 3966c5f559..4b539ff2b9 100644 --- a/common/lib/xmodule/xmodule/tests/test_html_module.py +++ b/common/lib/xmodule/xmodule/tests/test_html_module.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import unittest diff --git a/common/lib/xmodule/xmodule/tests/test_import.py b/common/lib/xmodule/xmodule/tests/test_import.py index e13f8f11e9..9a3a09fc04 100644 --- a/common/lib/xmodule/xmodule/tests/test_import.py +++ b/common/lib/xmodule/xmodule/tests/test_import.py @@ -1,4 +1,5 @@ -# -*- coding: utf-8 -*- # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring +# -*- coding: utf-8 -*- import datetime diff --git a/common/lib/xmodule/xmodule/timeinfo.py b/common/lib/xmodule/xmodule/timeinfo.py index ff3c94c870..5af457f3da 100644 --- a/common/lib/xmodule/xmodule/timeinfo.py +++ b/common/lib/xmodule/xmodule/timeinfo.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import logging diff --git a/common/lib/xmodule/xmodule/util/sandboxing.py b/common/lib/xmodule/xmodule/util/sandboxing.py index 780a7a7ce3..49114b36b3 100644 --- a/common/lib/xmodule/xmodule/util/sandboxing.py +++ b/common/lib/xmodule/xmodule/util/sandboxing.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import re diff --git a/common/lib/xmodule/xmodule/wrapper_module.py b/common/lib/xmodule/xmodule/wrapper_module.py index d42e355d16..a2603f290d 100644 --- a/common/lib/xmodule/xmodule/wrapper_module.py +++ b/common/lib/xmodule/xmodule/wrapper_module.py @@ -1,4 +1,5 @@ -# Same as vertical, # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring +# Same as vertical, # But w/o css delimiters between children diff --git a/common/lib/xmodule/xmodule/x_module.py b/common/lib/xmodule/xmodule/x_module.py index f022644dc8..542b876327 100644 --- a/common/lib/xmodule/xmodule/x_module.py +++ b/common/lib/xmodule/xmodule/x_module.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import logging import os @@ -1481,7 +1481,6 @@ class DescriptorSystem(MetricsMixin, ConfigurableFragmentWrapper, Runtime): """ Base class for :class:`Runtime`s to be used with :class:`XModuleDescriptor`s """ - # lint-amnesty, pylint: disable=bad-continuation, bad-option-value def __init__( self, load_item, resources_fs, error_tracker, get_policy=None, disabled_xblock_types=lambda: [], **kwargs ): diff --git a/common/lib/xmodule/xmodule/xml_module.py b/common/lib/xmodule/xmodule/xml_module.py index ca97bc6b73..13affa6ecd 100644 --- a/common/lib/xmodule/xmodule/xml_module.py +++ b/common/lib/xmodule/xmodule/xml_module.py @@ -1,4 +1,4 @@ - # lint-amnesty, pylint: disable=missing-module-docstring +# lint-amnesty, pylint: disable=missing-module-docstring import copy import json diff --git a/lms/djangoapps/courseware/model_data.py b/lms/djangoapps/courseware/model_data.py index f74dc1df7e..af372a49ff 100644 --- a/lms/djangoapps/courseware/model_data.py +++ b/lms/djangoapps/courseware/model_data.py @@ -109,7 +109,7 @@ class DjangoKeyValueStore(KeyValueStore): Scope.user_info, ) - def __init__(self, field_data_cache): + def __init__(self, field_data_cache): # lint-amnesty, pylint: disable=super-init-not-called self._field_data_cache = field_data_cache def get(self, key): diff --git a/lms/djangoapps/instructor/views/instructor_dashboard.py b/lms/djangoapps/instructor/views/instructor_dashboard.py index b75acb4d06..e72f25455a 100644 --- a/lms/djangoapps/instructor/views/instructor_dashboard.py +++ b/lms/djangoapps/instructor/views/instructor_dashboard.py @@ -25,7 +25,7 @@ from mock import patch from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from six import text_type -from six.moves.urllib.parse import urljoin +from six.moves.urllib.parse import urljoin # lint-amnesty, pylint: disable=unused-import from xblock.field_data import DictFieldData from xblock.fields import ScopeIds diff --git a/lms/lib/xblock/test/test_mixin.py b/lms/lib/xblock/test/test_mixin.py index 856eaf1f52..28cfbdc21e 100644 --- a/lms/lib/xblock/test/test_mixin.py +++ b/lms/lib/xblock/test/test_mixin.py @@ -1,7 +1,7 @@ +# lint-amnesty, pylint: disable=django-not-configured """ Tests of the LMS XBlock Mixin """ -# pylint: disable=cyclic-import import ddt from xblock.validation import ValidationMessage diff --git a/pylintrc b/pylintrc index c6fe751815..63949aa1ef 100644 --- a/pylintrc +++ b/pylintrc @@ -364,6 +364,7 @@ disable = no-else-continue, useless-object-inheritance, useless-suppression, + cyclic-import, [REPORTS] output-format = text