diff --git a/common/lib/xmodule/xmodule/modulestore/xml.py b/common/lib/xmodule/xmodule/modulestore/xml.py index 00dd3a57d4..d217773a1a 100644 --- a/common/lib/xmodule/xmodule/modulestore/xml.py +++ b/common/lib/xmodule/xmodule/modulestore/xml.py @@ -448,7 +448,7 @@ class XMLModuleStore(ModuleStoreReadBase): org = 'edx' # Parent XML should be something like 'library.xml' or 'course.xml' - courselike_label = self.parent_xml.split('.')[0] + courselike_label = self.parent_xml.split('.', maxsplit=1)[0] course = course_data.get(courselike_label) diff --git a/openedx/core/lib/api/view_utils.py b/openedx/core/lib/api/view_utils.py index 654b860e31..1cedc64039 100644 --- a/openedx/core/lib/api/view_utils.py +++ b/openedx/core/lib/api/view_utils.py @@ -2,7 +2,7 @@ Utilities related to API views """ -from collections import Sequence # lint-amnesty, pylint: disable=no-name-in-module +from collections import Sequence # lint-amnesty, pylint: disable=no-name-in-module, deprecated-class from functools import wraps from django.core.exceptions import NON_FIELD_ERRORS, ObjectDoesNotExist, ValidationError diff --git a/pavelib/tests.py b/pavelib/tests.py index 6a92a9e9e7..b1c4ff7a4a 100644 --- a/pavelib/tests.py +++ b/pavelib/tests.py @@ -6,7 +6,7 @@ Unit test tasks import os import re import sys -from optparse import make_option +from optparse import make_option # pylint: disable=deprecated-module from paver.easy import cmdopts, needs, sh, task, call_task diff --git a/pavelib/utils/passthrough_opts.py b/pavelib/utils/passthrough_opts.py index 013ec40bd5..297b3ba294 100644 --- a/pavelib/utils/passthrough_opts.py +++ b/pavelib/utils/passthrough_opts.py @@ -9,7 +9,7 @@ Provides: """ -from optparse import BadOptionError, OptionParser +from optparse import BadOptionError, OptionParser # pylint: disable=deprecated-module from unittest.mock import patch import paver.tasks diff --git a/pavelib/utils/test/bokchoy_options.py b/pavelib/utils/test/bokchoy_options.py index 672fc57814..b7e8fbd878 100644 --- a/pavelib/utils/test/bokchoy_options.py +++ b/pavelib/utils/test/bokchoy_options.py @@ -4,7 +4,7 @@ Definitions of all options used by the various bok_choy tasks. import os -from optparse import make_option +from optparse import make_option # pylint: disable=deprecated-module from pavelib.utils.envs import Env diff --git a/pylintrc b/pylintrc index 6facc28712..3e82d410da 100644 --- a/pylintrc +++ b/pylintrc @@ -75,10 +75,10 @@ persistent = yes load-plugins = edx_lint.pylint,pylint_django_settings,pylint_django,pylint_celery,pylint_pytest [MESSAGES CONTROL] -enable = +enable = blacklisted-name, line-too-long, - + abstract-class-instantiated, abstract-method, access-member-before-definition, @@ -215,7 +215,7 @@ enable = using-constant-test, yield-outside-function, zip-builtin-not-iterating, - + astroid-error, django-not-available-placeholder, django-not-available, @@ -223,20 +223,20 @@ enable = method-check-failed, parse-error, raw-checker-failed, - + empty-docstring, invalid-characters-in-docstring, missing-docstring, wrong-spelling-in-comment, wrong-spelling-in-docstring, - + unused-argument, unused-import, unused-variable, - + eval-used, exec-used, - + bad-classmethod-argument, bad-mcs-classmethod-argument, bad-mcs-method-argument, @@ -274,31 +274,31 @@ enable = unneeded-not, useless-else-on-loop, wrong-assert-type, - + deprecated-method, deprecated-module, - + too-many-boolean-expressions, too-many-nested-blocks, too-many-statements, - + wildcard-import, wrong-import-order, wrong-import-position, - + missing-final-newline, mixed-indentation, mixed-line-endings, trailing-newlines, trailing-whitespace, unexpected-line-ending-format, - + bad-inline-option, bad-option-value, deprecated-pragma, unrecognized-inline-option, useless-suppression, - + cmp-method, coerce-method, delslice-method, @@ -315,7 +315,7 @@ enable = rdiv-method, setslice-method, using-cmp-argument, -disable = +disable = bad-continuation, bad-indentation, duplicate-code, @@ -342,10 +342,10 @@ disable = too-many-return-statements, ungrouped-imports, unused-wildcard-import, - + feature-toggle-needs-doc, illegal-waffle-usage, - + apply-builtin, backtick, bad-python3-import, @@ -383,7 +383,7 @@ disable = unicode-builtin, unpacking-in-except, xrange-builtin, - + logging-fstring-interpolation, native-string, import-outside-toplevel, @@ -395,6 +395,13 @@ disable = cyclic-import, logging-format-interpolation, wrong-import-order, + consider-using-dict-items, + unnecessary-dict-index-lookup, + arguments-renamed, + consider-using-from-import, + consider-using-enumerate, + no-member, + consider-using-with, [REPORTS] output-format = text @@ -440,7 +447,7 @@ ignore-imports = no ignore-mixin-members = yes ignored-classes = SQLObject unsafe-load-any-extension = yes -generated-members = +generated-members = REQUEST, acl_users, aq_parent, @@ -466,7 +473,7 @@ generated-members = [VARIABLES] init-import = no dummy-variables-rgx = _|dummy|unused|.*_unused -additional-builtins = +additional-builtins = [CLASSES] defining-attr-methods = __init__,__new__,setUp @@ -487,11 +494,11 @@ max-public-methods = 20 [IMPORTS] deprecated-modules = regsub,TERMIOS,Bastion,rexec -import-graph = -ext-import-graph = -int-import-graph = +import-graph = +ext-import-graph = +int-import-graph = [EXCEPTIONS] overgeneral-exceptions = Exception -# 09db2baee601ac448d0a7336689375646b15fa35 +# da8e79d46675a1e64dfd1d3f1f909b06c63a6949 diff --git a/pylintrc_tweaks b/pylintrc_tweaks index 487ffeb483..3705fd84bf 100644 --- a/pylintrc_tweaks +++ b/pylintrc_tweaks @@ -1,6 +1,7 @@ # pylintrc tweaks for use with edx_lint. [MASTER] ignore+ = ,.git,.tox,migrations,node_modules,.pycharm_helpers +load-plugins = edx_lint.pylint,pylint_django_settings,pylint_django,pylint_celery,pylint_pytest [MESSAGES CONTROL] disable+ = @@ -15,8 +16,14 @@ disable+ = useless-suppression, cyclic-import, logging-format-interpolation, - # isort>5.0.0 introduced this warnings in a lot of import statements wrong-import-order, + consider-using-dict-items, + unnecessary-dict-index-lookup, + arguments-renamed, + consider-using-from-import, + consider-using-enumerate, + no-member, + consider-using-with, [BASIC] attr-rgx = [a-z_][a-z0-9_]{2,40}$ diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 68baf2f796..707076e41b 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -93,9 +93,6 @@ social-auth-core<4.0.0 # social-auth-core>=4.0.0 requires PYJWT>=2.0.0 # celery requires click<8.0.0 which would be fixed once https://github.com/celery/celery/issues/6753 is done. click<8.0.0 -# pylint==2.9.3 introduced a lot of new warnings. It will be removed in https://openedx.atlassian.net/browse/BOM-2667. -pylint==2.8.3 - # constraints present due to Python35 support. Need to be tested and removed independently. # jsonfield2 will be replaced with jsonfield in https://openedx.atlassian.net/browse/BOM-1917. diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index 8408dd2b34..f929297986 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -57,7 +57,7 @@ appdirs==1.4.4 # via # -r requirements/edx/testing.txt # fs -astroid==2.5.6 +astroid==2.6.2 # via # -r requirements/edx/testing.txt # pylint @@ -996,9 +996,8 @@ pylatexenc==2.10 # via # -r requirements/edx/testing.txt # olxcleaner -pylint==2.8.3 +pylint==2.9.3 # via - # -c requirements/edx/../constraints.txt # -r requirements/edx/testing.txt # edx-lint # pylint-celery diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index c24f7d15f0..e25c7183ba 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -55,7 +55,7 @@ appdirs==1.4.4 # via # -r requirements/edx/base.txt # fs -astroid==2.5.6 +astroid==2.6.2 # via # pylint # pylint-celery @@ -941,9 +941,8 @@ pylatexenc==2.10 # via # -r requirements/edx/base.txt # olxcleaner -pylint==2.8.3 +pylint==2.9.3 # via - # -c requirements/edx/../constraints.txt # edx-lint # pylint-celery # pylint-django