kopia lustrzana https://github.com/wagtail/wagtail
Narrow down 'noqa' directives on imports to specify F401 / F403
This prevents them from masking unrelated linting errors such as isort order.pull/10556/head
rodzic
d74fdee3a5
commit
9fe13dfe9f
2
setup.py
2
setup.py
|
@ -13,7 +13,7 @@ except ImportError:
|
|||
# in multiprocessing/util.py _exit_function when setup.py exits
|
||||
# (see http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
|
||||
try:
|
||||
import multiprocessing # noqa
|
||||
import multiprocessing # noqa: F401
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from django.apps import AppConfig
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from . import checks # NOQA
|
||||
from . import checks # NOQA: F401
|
||||
|
||||
|
||||
class WagtailAdminAppConfig(AppConfig):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import warnings
|
||||
|
||||
from wagtail.blocks import * # noqa
|
||||
from wagtail.blocks import * # noqa: F403
|
||||
|
||||
warnings.warn(
|
||||
"wagtail.admin.blocks has moved to wagtail.blocks", UserWarning, stacklevel=2
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# definitions which are not being deprecated from wagtail.admin.forms
|
||||
from .models import ( # NOQA
|
||||
from .models import ( # NOQA: F401
|
||||
DIRECT_FORM_FIELD_OVERRIDES,
|
||||
FORM_FIELD_OVERRIDES,
|
||||
WagtailAdminModelForm,
|
||||
WagtailAdminModelFormMetaclass,
|
||||
formfield_for_dbfield,
|
||||
)
|
||||
from .pages import WagtailAdminPageForm # NOQA
|
||||
from .pages import WagtailAdminPageForm # NOQA: F401
|
||||
|
|
|
@ -7,7 +7,7 @@ from taggit.models import Tag
|
|||
# wagtail admin (namely, base_form_class and get_edit_handler). Importing this within
|
||||
# wagtail.admin.models ensures that this happens in advance of running wagtail.admin's
|
||||
# system checks.
|
||||
from wagtail.admin import panels # NOQA
|
||||
from wagtail.admin import panels # NOQA: F401
|
||||
from wagtail.models import Page
|
||||
|
||||
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
# DIRECT_FORM_FIELD_OVERRIDES, FORM_FIELD_OVERRIDES are imported for backwards
|
||||
# compatibility, as people are likely importing them from here and then
|
||||
# appending their own overrides
|
||||
from wagtail.admin.forms.models import ( # NOQA
|
||||
from wagtail.admin.forms.models import ( # NOQA: F401
|
||||
DIRECT_FORM_FIELD_OVERRIDES,
|
||||
FORM_FIELD_OVERRIDES,
|
||||
)
|
||||
|
||||
from .base import * # NOQA
|
||||
from .comment_panel import * # NOQA
|
||||
from .field_panel import * # NOQA
|
||||
from .group import * # NOQA
|
||||
from .help_panel import * # NOQA
|
||||
from .inline_panel import * # NOQA
|
||||
from .model_utils import * # NOQA
|
||||
from .multiple_chooser_panel import * # NOQA
|
||||
from .page_chooser_panel import * # NOQA
|
||||
from .page_utils import * # NOQA
|
||||
from .publishing_panel import * # NOQA
|
||||
from .signal_handlers import * # NOQA
|
||||
from .base import * # NOQA: F403
|
||||
from .comment_panel import * # NOQA: F403
|
||||
from .field_panel import * # NOQA: F403
|
||||
from .group import * # NOQA: F403
|
||||
from .help_panel import * # NOQA: F403
|
||||
from .inline_panel import * # NOQA: F403
|
||||
from .model_utils import * # NOQA: F403
|
||||
from .multiple_chooser_panel import * # NOQA: F403
|
||||
from .page_chooser_panel import * # NOQA: F403
|
||||
from .page_utils import * # NOQA: F403
|
||||
from .publishing_panel import * # NOQA: F403
|
||||
from .signal_handlers import * # NOQA: F403
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from django.conf import settings
|
||||
from django.utils.module_loading import import_string
|
||||
|
||||
from wagtail.admin.rich_text.editors.draftail import DraftailRichTextArea # NOQA
|
||||
from wagtail.admin.rich_text.editors.draftail import DraftailRichTextArea # NOQA: F401
|
||||
|
||||
DEFAULT_RICH_TEXT_EDITORS = {
|
||||
"default": {"WIDGET": "wagtail.admin.rich_text.DraftailRichTextArea"}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
# Retain backwards compatibility for imports
|
||||
from wagtail.admin.utils import get_valid_next_url_from_request # noqa
|
||||
from wagtail.admin.utils import get_valid_next_url_from_request # noqa: F401
|
||||
|
|
|
@ -1 +1 @@
|
|||
from .base import PageReportView, ReportView # noqa
|
||||
from .base import PageReportView, ReportView # noqa: F401
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
from wagtail.admin.widgets.auto_height_text import * # NOQA
|
||||
from wagtail.admin.widgets.boolean_radio_select import * # NOQA
|
||||
from wagtail.admin.widgets.button import * # NOQA
|
||||
from wagtail.admin.widgets.chooser import * # NOQA
|
||||
from wagtail.admin.widgets.datetime import * # NOQA
|
||||
from wagtail.admin.widgets.filtered_select import * # NOQA
|
||||
from wagtail.admin.widgets.switch import * # NOQA
|
||||
from wagtail.admin.widgets.tags import * # NOQA
|
||||
from wagtail.admin.widgets.auto_height_text import * # NOQA: F403
|
||||
from wagtail.admin.widgets.boolean_radio_select import * # NOQA: F403
|
||||
from wagtail.admin.widgets.button import * # NOQA: F403
|
||||
from wagtail.admin.widgets.chooser import * # NOQA: F403
|
||||
from wagtail.admin.widgets.datetime import * # NOQA: F403
|
||||
from wagtail.admin.widgets.filtered_select import * # NOQA: F403
|
||||
from wagtail.admin.widgets.switch import * # NOQA: F403
|
||||
from wagtail.admin.widgets.tags import * # NOQA: F403
|
||||
|
|
|
@ -1 +1 @@
|
|||
from .conf import APIField # noqa
|
||||
from .conf import APIField # noqa: F401
|
||||
|
|
|
@ -20,4 +20,4 @@ class WagtailAppConfig(AppConfig):
|
|||
|
||||
register_signal_handlers()
|
||||
|
||||
from wagtail import widget_adapters # noqa
|
||||
from wagtail import widget_adapters # noqa: F401
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Import block types defined in submodules into the wagtail.blocks namespace
|
||||
from .base import * # NOQA
|
||||
from .field_block import * # NOQA
|
||||
from .list_block import * # NOQA
|
||||
from .static_block import * # NOQA
|
||||
from .stream_block import * # NOQA
|
||||
from .struct_block import * # NOQA
|
||||
from .base import * # NOQA: F403
|
||||
from .field_block import * # NOQA: F403
|
||||
from .list_block import * # NOQA: F403
|
||||
from .static_block import * # NOQA: F403
|
||||
from .stream_block import * # NOQA: F403
|
||||
from .struct_block import * # NOQA: F403
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from .button import ButtonHelper, PageButtonHelper # NOQA
|
||||
from .permission import PagePermissionHelper, PermissionHelper # NOQA
|
||||
from .search import DjangoORMSearchHandler, WagtailBackendSearchHandler # NOQA
|
||||
from .url import AdminURLHelper, ModelAdminURLFinder, PageAdminURLHelper # NOQA
|
||||
from .button import ButtonHelper, PageButtonHelper # NOQA: F401
|
||||
from .permission import PagePermissionHelper, PermissionHelper # NOQA: F401
|
||||
from .search import DjangoORMSearchHandler, WagtailBackendSearchHandler # NOQA: F401
|
||||
from .url import AdminURLHelper, ModelAdminURLFinder, PageAdminURLHelper # NOQA: F401
|
||||
|
|
|
@ -25,7 +25,7 @@ from .helpers import (
|
|||
PermissionHelper,
|
||||
)
|
||||
from .menus import GroupMenuItem, ModelAdminMenuItem
|
||||
from .mixins import ThumbnailMixin # NOQA
|
||||
from .mixins import ThumbnailMixin # NOQA: F401
|
||||
from .views import (
|
||||
ChooseParentView,
|
||||
CreateView,
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
from .generic import * # noqa
|
||||
from .site_specific import * # noqa
|
|
@ -1 +1 @@
|
|||
from .sitemap_generator import Sitemap # noqa
|
||||
from .sitemap_generator import Sitemap # noqa: F401
|
||||
|
|
|
@ -269,7 +269,7 @@ class TestServeViewWithSendfile(TestCase):
|
|||
# Import using a try-catch block to prevent crashes if the
|
||||
# django-sendfile module is not installed
|
||||
try:
|
||||
import sendfile # noqa
|
||||
import sendfile # noqa: F401
|
||||
except ImportError:
|
||||
raise unittest.SkipTest("django-sendfile not installed")
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ from wagtail.embeds.templatetags.wagtailembeds_tags import embed_tag
|
|||
from wagtail.test.utils import WagtailTestUtils
|
||||
|
||||
try:
|
||||
import embedly # noqa
|
||||
import embedly # noqa: F401
|
||||
|
||||
no_embedly = False
|
||||
except ImportError:
|
||||
|
|
|
@ -2,7 +2,7 @@ from django.apps import AppConfig
|
|||
from django.db.models import ForeignKey
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from . import checks, get_image_model # NOQA
|
||||
from . import checks, get_image_model # NOQA: F401
|
||||
from .signal_handlers import register_signal_handlers
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ from wagtail.test.utils import WagtailTestUtils, disconnect_signal_receiver
|
|||
from .utils import Image, get_test_image_file
|
||||
|
||||
try:
|
||||
import sendfile # noqa
|
||||
import sendfile # noqa: F401
|
||||
|
||||
sendfile_mod = True
|
||||
except ImportError:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
wagtail.models is split into submodules for maintainability. All definitions intended as
|
||||
public should be imported here (with 'noqa' comments as required) and outside code should continue
|
||||
to import them from wagtail.models (e.g. `from wagtail.models import Site`, not
|
||||
public should be imported here (with 'noqa: F401' comments as required) and outside code should
|
||||
continue to import them from wagtail.models (e.g. `from wagtail.models import Site`, not
|
||||
`from wagtail.models.sites import Site`.)
|
||||
|
||||
Submodules should take care to keep the direction of dependencies consistent; where possible they
|
||||
|
@ -92,13 +92,13 @@ from wagtail.signals import (
|
|||
from wagtail.url_routing import RouteResult
|
||||
from wagtail.utils.deprecation import RemovedInWagtail60Warning
|
||||
|
||||
from .audit_log import ( # noqa
|
||||
from .audit_log import ( # noqa: F401
|
||||
BaseLogEntry,
|
||||
BaseLogEntryManager,
|
||||
LogEntryQuerySet,
|
||||
ModelLogEntry,
|
||||
)
|
||||
from .collections import ( # noqa
|
||||
from .collections import ( # noqa: F401
|
||||
BaseCollectionManager,
|
||||
Collection,
|
||||
CollectionManager,
|
||||
|
@ -108,8 +108,8 @@ from .collections import ( # noqa
|
|||
GroupCollectionPermissionManager,
|
||||
get_root_collection_id,
|
||||
)
|
||||
from .copying import _copy, _copy_m2m_relations, _extract_field_data # noqa
|
||||
from .i18n import ( # noqa
|
||||
from .copying import _copy, _copy_m2m_relations, _extract_field_data # noqa: F401
|
||||
from .i18n import ( # noqa: F401
|
||||
BootstrapTranslatableMixin,
|
||||
BootstrapTranslatableModel,
|
||||
Locale,
|
||||
|
@ -118,8 +118,8 @@ from .i18n import ( # noqa
|
|||
bootstrap_translatable_model,
|
||||
get_translatable_models,
|
||||
)
|
||||
from .reference_index import ReferenceIndex # noqa
|
||||
from .sites import Site, SiteManager, SiteRootPath # noqa
|
||||
from .reference_index import ReferenceIndex # noqa: F401
|
||||
from .sites import Site, SiteManager, SiteRootPath # noqa: F401
|
||||
from .specific import SpecificMixin
|
||||
from .view_restrictions import BaseViewRestriction
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
from .base import * # NOQA
|
||||
from .base import * # NOQA: F403
|
||||
|
|
|
@ -5,7 +5,7 @@ from django.utils.translation import gettext_lazy as _
|
|||
|
||||
from wagtail.search.signal_handlers import register_signal_handlers
|
||||
|
||||
from . import checks # NOQA
|
||||
from . import checks # NOQA: F401
|
||||
|
||||
|
||||
class WagtailSearchAppConfig(AppConfig):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Alias for the update_index command, to avoid clashes with other packages
|
||||
# that implement an update_index command (such as django-haystack)
|
||||
|
||||
from wagtail.search.management.commands.update_index import Command # NOQA
|
||||
from wagtail.search.management.commands.update_index import Command # NOQA: F401
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Generated by Django 3.2.4 on 2021-06-28 14:12
|
||||
|
||||
import django.db.models.deletion # noqa
|
||||
import django.db.models.deletion
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from django import forms
|
||||
from telepath import Adapter, AdapterRegistry, JSContextBase # noqa
|
||||
from telepath import Adapter, AdapterRegistry, JSContextBase
|
||||
|
||||
from wagtail.admin.staticfiles import versioned_static
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ from django.db import models
|
|||
# make sure we can import wagtail.admin.auth here without triggering a circular import
|
||||
# (which is easily done because it's dealing with django.contrib.auth views which depend
|
||||
# on the user model)
|
||||
from wagtail.admin.auth import permission_denied # noqa
|
||||
from wagtail.admin.auth import permission_denied # noqa: F401
|
||||
from wagtail.admin.panels import FieldPanel
|
||||
|
||||
from .fields import ConvertedValueField
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from .settings import * # noqa
|
||||
from .settings import * # noqa: F403
|
||||
|
||||
# Settings meant to run the test suite with Django’s development server, for integration tests.
|
||||
DEBUG = True
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
from .decorators import * # NOQA
|
||||
from .page_tests import * # NOQA
|
||||
from .wagtail_tests import * # NOQA
|
||||
from .decorators import * # NOQA: F403
|
||||
from .page_tests import * # NOQA: F403
|
||||
from .wagtail_tests import * # NOQA: F403
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
from .blocks import * # noqa
|
||||
from .factories import * # noqa
|
||||
from .blocks import * # noqa: F403
|
||||
from .factories import * # noqa: F403
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from warnings import warn
|
||||
|
||||
from wagtail.test.utils import * # noqa
|
||||
from wagtail.test.utils import * # noqa: F403
|
||||
from wagtail.utils.deprecation import RemovedInWagtail60Warning
|
||||
|
||||
warn(
|
||||
|
|
Ładowanie…
Reference in New Issue