This is an automated email from the ASF dual-hosted git repository. brondsem pushed a commit to branch db/8532 in repository https://gitbox.apache.org/repos/asf/allura.git
commit e4ec8e799010bd03e9959e55b7ee17decd3dd69c Author: Dave Brondsema <dbronds...@slashdotmedia.com> AuthorDate: Wed Jan 3 11:46:13 2024 -0500 [#8532] fix E402 --- Allura/allura/config/middleware.py | 1 + Allura/allura/lib/app_globals.py | 5 ++--- Allura/allura/websetup/__init__.py | 9 +++------ ruff.toml | 1 - 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Allura/allura/config/middleware.py b/Allura/allura/config/middleware.py index f8378b1fe..75aa2a160 100644 --- a/Allura/allura/config/middleware.py +++ b/Allura/allura/config/middleware.py @@ -44,6 +44,7 @@ from beaker_session_jwt import JWTCookieSession # Must apply patches before other Allura imports to ensure all the patches are effective. # This file gets imported from paste/deploy/loadwsgi.py pretty early in the app execution +# ruff: noqa: E402 from allura.lib import patches patches.apply() try: diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py index 2016d6b48..eadabd9bd 100644 --- a/Allura/allura/lib/app_globals.py +++ b/Allura/allura/lib/app_globals.py @@ -17,9 +17,6 @@ from __future__ import annotations import re - -"""The application's Globals object""" - import logging import html import hashlib @@ -69,6 +66,8 @@ from allura.lib.solr import MockSOLR, make_solr_from_config from allura.model.session import artifact_orm_session import six +"""The application's Globals object""" + __all__ = ['Globals'] log = logging.getLogger(__name__) diff --git a/Allura/allura/websetup/__init__.py b/Allura/allura/websetup/__init__.py index 936dd149b..f8a254fdb 100644 --- a/Allura/allura/websetup/__init__.py +++ b/Allura/allura/websetup/__init__.py @@ -15,19 +15,16 @@ # specific language governing permissions and limitations # under the License. -"""Setup the allura application""" - import logging - from allura.config.app_cfg import base_config +from .schema import setup_schema +from . import bootstrap + __all__ = ['setup_app'] log = logging.getLogger(__name__) -from .schema import setup_schema -from . import bootstrap - def setup_app(command, conf, vars): """Place any commands to setup allura here""" diff --git a/ruff.toml b/ruff.toml index f7453d735..7fdb9bcd6 100644 --- a/ruff.toml +++ b/ruff.toml @@ -33,7 +33,6 @@ ignore = [ 'F401', # Imported but unused, 'F811', # Redefinition of unused 'F841', # Assigned to but never used - 'E402', # Module level import not at top of file 'E731', # Do not assign a lambda expression, use a def 'E741', # Ambiguous variable name: I, 'E501', # Line too long