chore: removed 'wrong-import-order' from disabled imports (#29365)
* chore: removed 'wrong-import-order' from disabled imports
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
|
||||
from django.conf import settings
|
||||
from django.urls import re_path
|
||||
|
||||
from cms.djangoapps.contentstore.api.views import course_import, course_quality, course_validation
|
||||
from django.urls import re_path
|
||||
|
||||
app_name = 'contentstore'
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@ Tests for the course tab API.
|
||||
"""
|
||||
|
||||
import json
|
||||
import random
|
||||
from urllib.parse import urlencode
|
||||
|
||||
import ddt
|
||||
import random
|
||||
from django.urls import reverse
|
||||
from xmodule.modulestore.tests.factories import ItemFactory
|
||||
from xmodule.tabs import CourseTabList
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
URLs for the maintenance app.
|
||||
"""
|
||||
|
||||
from django.urls import path, re_path
|
||||
|
||||
from .views import (
|
||||
AnnouncementCreateView,
|
||||
AnnouncementDeleteView,
|
||||
@@ -10,7 +12,6 @@ from .views import (
|
||||
ForcePublishCourseView,
|
||||
MaintenanceIndexView
|
||||
)
|
||||
from django.urls import path, re_path
|
||||
|
||||
app_name = 'cms.djangoapps.maintenance'
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ development mode; otherwise, it is ignored.
|
||||
"""
|
||||
|
||||
|
||||
from cms.djangoapps.contentstore.views.dev import dev_mode
|
||||
from django.urls import path
|
||||
from cms.djangoapps.contentstore.views.dev import dev_mode
|
||||
|
||||
urlpatterns = [
|
||||
path('dev_mode', dev_mode, name='dev_mode'),
|
||||
|
||||
@@ -5,8 +5,8 @@ URL definitions for the course_modes v1 API.
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from common.djangoapps.course_modes.rest_api.v1 import views
|
||||
from django.urls import re_path
|
||||
from common.djangoapps.course_modes.rest_api.v1 import views
|
||||
|
||||
app_name = 'v1'
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from common.djangoapps.course_modes import views
|
||||
from django.urls import re_path
|
||||
from common.djangoapps.course_modes import views
|
||||
|
||||
urlpatterns = [
|
||||
re_path(fr'^choose/{settings.COURSE_ID_PATTERN}/$', views.ChooseModeView.as_view(), name='course_modes_choose'),
|
||||
|
||||
@@ -5,8 +5,8 @@ URLs for the V1 of the Entitlements API.
|
||||
from django.conf.urls import include
|
||||
from rest_framework.routers import DefaultRouter
|
||||
|
||||
from .views import EntitlementEnrollmentViewSet, EntitlementViewSet
|
||||
from django.urls import path, re_path
|
||||
from .views import EntitlementEnrollmentViewSet, EntitlementViewSet
|
||||
|
||||
router = DefaultRouter()
|
||||
router.register(r'entitlements', EntitlementViewSet, basename='entitlements')
|
||||
|
||||
@@ -4,9 +4,9 @@ URLs for student app
|
||||
|
||||
|
||||
from django.conf import settings
|
||||
from django.urls import path, re_path
|
||||
|
||||
from . import views
|
||||
from django.urls import path, re_path
|
||||
|
||||
urlpatterns = [
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
|
||||
from django.conf import settings
|
||||
from django.urls import path, re_path
|
||||
|
||||
from .views import ThirdPartyAuthUserStatusView, UserMappingView, UserView, UserViewV2
|
||||
from django.urls import path, re_path
|
||||
|
||||
PROVIDER_PATTERN = r'(?P<provider_id>[\w.+-]+)(?:\:(?P<idp_slug>[\w.+-]+))?'
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Url configuration for the auth module."""
|
||||
|
||||
from django.conf.urls import include
|
||||
from django.urls import path, re_path
|
||||
|
||||
from .views import (
|
||||
IdPRedirectView,
|
||||
@@ -9,7 +10,6 @@ from .views import (
|
||||
post_to_custom_auth_form,
|
||||
saml_metadata_view
|
||||
)
|
||||
from django.urls import path, re_path
|
||||
|
||||
urlpatterns = [
|
||||
path('auth/inactive', inactive_user_view, name="third_party_inactive_redirect"),
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"""
|
||||
URLs for track app
|
||||
"""
|
||||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
from .views import segmentio
|
||||
from django.urls import path
|
||||
|
||||
urlpatterns = [
|
||||
path('event', views.user_track),
|
||||
|
||||
@@ -41,7 +41,7 @@ from xblock.runtime import KvsFieldData
|
||||
|
||||
from common.djangoapps import static_replace
|
||||
from common.djangoapps.xblock_django.constants import ATTR_KEY_USER_ID
|
||||
from capa.xqueue_interface import XQueueService
|
||||
from capa.xqueue_interface import XQueueService # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from lms.djangoapps.courseware.access import get_user_role, has_access
|
||||
from lms.djangoapps.courseware.entrance_exams import user_can_skip_entrance_exam, user_has_passed_entrance_exam
|
||||
from lms.djangoapps.courseware.masquerade import (
|
||||
|
||||
@@ -5,6 +5,7 @@ from __future__ import annotations
|
||||
|
||||
import itertools
|
||||
from collections import defaultdict
|
||||
from enum import Enum
|
||||
from typing import Dict, List, Literal, Optional, Set, Tuple
|
||||
from urllib.parse import urlencode, urlunparse
|
||||
|
||||
@@ -12,11 +13,12 @@ from django.contrib.auth import get_user_model
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.http import Http404
|
||||
from django.urls import reverse
|
||||
from enum import Enum # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from opaque_keys import InvalidKeyError
|
||||
from opaque_keys.edx.locator import CourseKey
|
||||
from rest_framework.exceptions import PermissionDenied
|
||||
from rest_framework.request import Request
|
||||
from xmodule.course_module import CourseBlock
|
||||
from xmodule.tabs import CourseTabList
|
||||
|
||||
from lms.djangoapps.courseware.courses import get_course_with_access
|
||||
from lms.djangoapps.courseware.exceptions import CourseAccessRedirect
|
||||
@@ -44,8 +46,6 @@ from openedx.core.djangoapps.django_comment_common.signals import (
|
||||
from openedx.core.djangoapps.user_api.accounts.api import get_account_settings
|
||||
from openedx.core.lib.exceptions import CourseNotFoundError, DiscussionNotFoundError, PageNotFoundError
|
||||
|
||||
from xmodule.course_module import CourseBlock # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from xmodule.tabs import CourseTabList
|
||||
from .exceptions import (
|
||||
CommentNotFoundError,
|
||||
DiscussionBlackOutException,
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
Unit tests covering the program discussion iframe API.
|
||||
"""
|
||||
|
||||
import ddt
|
||||
from uuid import uuid4
|
||||
import ddt
|
||||
|
||||
from django.urls import reverse_lazy
|
||||
from edx_toggles.toggles.testutils import override_waffle_flag
|
||||
|
||||
@@ -15,6 +15,12 @@ from django.test.client import RequestFactory
|
||||
|
||||
from edx_django_utils.cache import TieredCache
|
||||
from edx_toggles.toggles.testutils import override_waffle_flag
|
||||
from xmodule.data import CertificatesDisplayBehaviors
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import ItemFactory, ToyCourseFactory
|
||||
from xmodule.partitions.partitions import ENROLLMENT_TRACK_PARTITION_ID
|
||||
|
||||
from common.djangoapps.course_modes.models import CourseMode
|
||||
from common.djangoapps.course_modes.tests.factories import CourseModeFactory
|
||||
from lms.djangoapps.certificates.api import get_certificate_url
|
||||
@@ -39,12 +45,6 @@ from common.djangoapps.student.tests.factories import CourseEnrollmentCelebratio
|
||||
from openedx.core.djangoapps.agreements.api import create_integrity_signature
|
||||
from openedx.core.djangoapps.agreements.toggles import ENABLE_INTEGRITY_SIGNATURE
|
||||
|
||||
from xmodule.data import CertificatesDisplayBehaviors # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from xmodule.modulestore.tests.factories import ItemFactory, ToyCourseFactory # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from xmodule.partitions.partitions import ENROLLMENT_TRACK_PARTITION_ID
|
||||
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
Tests for discussions course block transformer
|
||||
"""
|
||||
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_SPLIT_MODULESTORE
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
|
||||
from lms.djangoapps.course_blocks.api import get_course_blocks
|
||||
from lms.djangoapps.course_blocks.transformers.tests.helpers import TransformerRegistryTestMixin
|
||||
from openedx.core.djangoapps.discussions.models import DEFAULT_PROVIDER_TYPE, DiscussionTopicLink
|
||||
from openedx.core.djangoapps.discussions.transformers import DiscussionsTopicLinkTransformer
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_SPLIT_MODULESTORE
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
|
||||
|
||||
class DiscussionsTopicLinkTransformerTestCase(TransformerRegistryTestMixin, ModuleStoreTestCase):
|
||||
|
||||
@@ -13,11 +13,11 @@ from lti_consumer.models import CourseAllowPIISharingInLTIFlag
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APITestCase
|
||||
|
||||
from common.djangoapps.student.tests.factories import UserFactory
|
||||
from lms.djangoapps.discussion.django_comment_client.tests.factories import RoleFactory
|
||||
from xmodule.modulestore import ModuleStoreEnum
|
||||
from xmodule.modulestore.tests.django_utils import CourseUserType, ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
from common.djangoapps.student.tests.factories import UserFactory
|
||||
from lms.djangoapps.discussion.django_comment_client.tests.factories import RoleFactory
|
||||
from ..models import AVAILABLE_PROVIDER_MAP, DEFAULT_CONFIG_ENABLED, DEFAULT_PROVIDER_TYPE, Provider
|
||||
|
||||
DATA_LEGACY_COHORTS = {
|
||||
|
||||
45
pylintrc
45
pylintrc
@@ -72,10 +72,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,
|
||||
@@ -212,7 +212,7 @@ enable =
|
||||
using-constant-test,
|
||||
yield-outside-function,
|
||||
zip-builtin-not-iterating,
|
||||
|
||||
|
||||
astroid-error,
|
||||
django-not-available-placeholder,
|
||||
django-not-available,
|
||||
@@ -220,20 +220,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,
|
||||
@@ -271,31 +271,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,
|
||||
@@ -312,7 +312,7 @@ enable =
|
||||
rdiv-method,
|
||||
setslice-method,
|
||||
using-cmp-argument,
|
||||
disable =
|
||||
disable =
|
||||
bad-continuation,
|
||||
bad-indentation,
|
||||
consider-using-f-string,
|
||||
@@ -342,10 +342,10 @@ disable =
|
||||
unspecified-encoding,
|
||||
unused-wildcard-import,
|
||||
use-maxsplit-arg,
|
||||
|
||||
|
||||
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,
|
||||
@@ -394,7 +394,6 @@ disable =
|
||||
useless-suppression,
|
||||
cyclic-import,
|
||||
logging-format-interpolation,
|
||||
wrong-import-order,
|
||||
consider-using-dict-items,
|
||||
unnecessary-dict-index-lookup,
|
||||
arguments-renamed,
|
||||
@@ -452,7 +451,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,
|
||||
@@ -478,7 +477,7 @@ generated-members =
|
||||
[VARIABLES]
|
||||
init-import = no
|
||||
dummy-variables-rgx = _|dummy|unused|.*_unused
|
||||
additional-builtins =
|
||||
additional-builtins =
|
||||
|
||||
[CLASSES]
|
||||
defining-attr-methods = __init__,__new__,setUp
|
||||
@@ -499,9 +498,9 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user