From feb75906356ba2dbff92cc8f3fe9d3923801c1f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 30 Mar 2021 11:13:29 +0200 Subject: [PATCH] misc: refer to pylint codes, not numbers (#52484) --- wcs/__init__.py | 4 ++-- wcs/publisher.py | 4 ++-- wcs/qommon/__init__.py | 8 +++---- wcs/qommon/spooler.py | 2 +- wcs/sql.py | 2 +- wcs/wf/roles.py | 3 ++- wcs/workflows.py | 51 +++++++++++++++++++++--------------------- 7 files changed, 38 insertions(+), 36 deletions(-) diff --git a/wcs/__init__.py b/wcs/__init__.py index c7e424854..5dada48be 100644 --- a/wcs/__init__.py +++ b/wcs/__init__.py @@ -19,5 +19,5 @@ import sys sys.path.insert(0, os.path.dirname(__file__)) -from . import monkeypatch # noqa isort: skip pylint: disable=C0413 -from . import compat # noqa isort: skip pylint: disable=C0413 +from . import monkeypatch # noqa isort: skip pylint: disable=wrong-import-position +from . import compat # noqa isort: skip pylint: disable=wrong-import-position diff --git a/wcs/publisher.py b/wcs/publisher.py index cd2e16cd2..de5c7dd4d 100644 --- a/wcs/publisher.py +++ b/wcs/publisher.py @@ -32,7 +32,7 @@ from . import custom_views from . import sessions from .admin import RootDirectory as AdminRootDirectory from .backoffice import RootDirectory as BackofficeRootDirectory -from .Defaults import * # noqa pylint: disable=W0401 +from .Defaults import * # noqa pylint: disable=wildcard-import from .qommon.cron import CronJob from .qommon.publisher import QommonPublisher from .qommon.publisher import get_request @@ -43,7 +43,7 @@ from .tracking_code import TrackingCode from .users import User try: - from .wcs_cfg import * # noqa pylint: disable=W0401 + from .wcs_cfg import * # noqa pylint: disable=wildcard-import except ImportError: pass diff --git a/wcs/qommon/__init__.py b/wcs/qommon/__init__.py index 520c1b8f0..3d33d46a2 100644 --- a/wcs/qommon/__init__.py +++ b/wcs/qommon/__init__.py @@ -55,10 +55,10 @@ def N_(x): return x -from . import publisher # noqa pylint: disable=C0413 -from .publisher import get_cfg # noqa pylint: disable=C0413 -from .publisher import get_logger # noqa pylint: disable=C0413 -from .publisher import get_publisher_class # noqa pylint: disable=C0413 +from . import publisher # noqa pylint: disable=wrong-import-position +from .publisher import get_cfg # noqa pylint: disable=wrong-import-position +from .publisher import get_logger # noqa pylint: disable=wrong-import-position +from .publisher import get_publisher_class # noqa pylint: disable=wrong-import-position publisher._ = _ diff --git a/wcs/qommon/spooler.py b/wcs/qommon/spooler.py index be7b35bec..cf77db8b0 100644 --- a/wcs/qommon/spooler.py +++ b/wcs/qommon/spooler.py @@ -16,7 +16,7 @@ import subprocess -from uwsgidecorators import spool # pylint: disable=E0401 +from uwsgidecorators import spool # pylint: disable=import-error @spool diff --git a/wcs/sql.py b/wcs/sql.py index fb1f9540d..288e58859 100644 --- a/wcs/sql.py +++ b/wcs/sql.py @@ -2414,7 +2414,7 @@ class SqlUser(SqlMixin, wcs.users.User): o.verified_fields, o.lasso_dump, o.last_seen, - ascii_name, # XXX what's this ? pylint: disable=W0612 + ascii_name, # XXX what's this ? pylint: disable=unused-variable o.deleted_timestamp, o.is_active, ) = [str_encode(x) for x in tuple(row[:13])] diff --git a/wcs/wf/roles.py b/wcs/wf/roles.py index e00e8980d..96a6a5023 100644 --- a/wcs/wf/roles.py +++ b/wcs/wf/roles.py @@ -189,7 +189,8 @@ class RemoveRoleWorkflowStatusItem(WorkflowStatusItem): def after_job(job=None): signed_url = sign_ws_url(url) - response, status, data, auth_header = http_delete_request(signed_url) # pylint: disable=W0612 + # pylint: disable=unused-variable + response, status, data, auth_header = http_delete_request(signed_url) if status != 200: get_logger().error('failed to remove role %r from user %r', role, user) diff --git a/wcs/workflows.py b/wcs/workflows.py index b5f425ca1..fd19d29c8 100644 --- a/wcs/workflows.py +++ b/wcs/workflows.py @@ -1325,8 +1325,9 @@ class WorkflowGlobalActionTimeoutTrigger(WorkflowGlobalActionTrigger): except Exception: # get the variables in the locals() namespace so they are # displayed within the trace. - expression = self.anchor_expression # noqa pylint: disable=W0612 - global_variables = get_publisher().get_global_eval_dict() # noqa pylint: disable=W0612 + expression = self.anchor_expression # noqa pylint: disable=unused-variable + # noqa pylint: disable=unused-variable + global_variables = get_publisher().get_global_eval_dict() get_publisher().notify_of_exception(sys.exc_info(), context='[TIMEOUTS]') # convert anchor_date to datetime.datetime() @@ -3321,29 +3322,29 @@ register_item_class(EditableWorkflowStatusItem) def load_extra(): - from .wf import aggregation_email # noqa pylint: disable=W0611 - from .wf import anonymise # noqa pylint: disable=W0611 - from .wf import attachment # noqa pylint: disable=W0611 - from .wf import backoffice_fields # noqa pylint: disable=W0611 - from .wf import create_carddata # noqa pylint: disable=W0611 - from .wf import create_formdata # noqa pylint: disable=W0611 - from .wf import criticality # noqa pylint: disable=W0611 - from .wf import dispatch # noqa pylint: disable=W0611 - from .wf import edit_carddata # noqa pylint: disable=W0611 - from .wf import export_to_model # noqa pylint: disable=W0611 - from .wf import external_workflow # noqa pylint: disable=W0611 - from .wf import form # noqa pylint: disable=W0611 - from .wf import geolocate # noqa pylint: disable=W0611 - from .wf import jump # noqa pylint: disable=W0611 - from .wf import notification # noqa pylint: disable=W0611 - from .wf import profile # noqa pylint: disable=W0611 - from .wf import redirect_to_url # noqa pylint: disable=W0611 - from .wf import register_comment # noqa pylint: disable=W0611 - from .wf import remove # noqa pylint: disable=W0611 - from .wf import resubmit # noqa pylint: disable=W0611 - from .wf import roles # noqa pylint: disable=W0611 - from .wf import timeout_jump # noqa pylint: disable=W0611 - from .wf import wscall # noqa pylint: disable=W0611 + from .wf import aggregation_email # noqa pylint: disable=unused-import + from .wf import anonymise # noqa pylint: disable=unused-import + from .wf import attachment # noqa pylint: disable=unused-import + from .wf import backoffice_fields # noqa pylint: disable=unused-import + from .wf import create_carddata # noqa pylint: disable=unused-import + from .wf import create_formdata # noqa pylint: disable=unused-import + from .wf import criticality # noqa pylint: disable=unused-import + from .wf import dispatch # noqa pylint: disable=unused-import + from .wf import edit_carddata # noqa pylint: disable=unused-import + from .wf import export_to_model # noqa pylint: disable=unused-import + from .wf import external_workflow # noqa pylint: disable=unused-import + from .wf import form # noqa pylint: disable=unused-import + from .wf import geolocate # noqa pylint: disable=unused-import + from .wf import jump # noqa pylint: disable=unused-import + from .wf import notification # noqa pylint: disable=unused-import + from .wf import profile # noqa pylint: disable=unused-import + from .wf import redirect_to_url # noqa pylint: disable=unused-import + from .wf import register_comment # noqa pylint: disable=unused-import + from .wf import remove # noqa pylint: disable=unused-import + from .wf import resubmit # noqa pylint: disable=unused-import + from .wf import roles # noqa pylint: disable=unused-import + from .wf import timeout_jump # noqa pylint: disable=unused-import + from .wf import wscall # noqa pylint: disable=unused-import from .wf.export_to_model import ExportToModel # noqa pylint: disable=unused-import,wrong-import-position