diff --git a/ruff.toml b/ruff.toml index 5491cfc..6baf6d9 100644 --- a/ruff.toml +++ b/ruff.toml @@ -46,7 +46,6 @@ lint.extend-ignore = [ # "E501", # line too long "E741", # Ambiguous variable name - # "F841", # Local variable `...` is assigned to but never used "FURB113", # Use `x.extend(...)` instead of repeatedly calling `x.append()` # "N801", # Class name should use CapWords convention diff --git a/src/abilian/sbe/apps/documents/models.py b/src/abilian/sbe/apps/documents/models.py index 42937f9..ee2c646 100644 --- a/src/abilian/sbe/apps/documents/models.py +++ b/src/abilian/sbe/apps/documents/models.py @@ -766,7 +766,7 @@ def _trigger_conversion_tasks(session: Session) -> None: document_queue = _get_documents_queue() while document_queue: - doc, task_id = document_queue.pop() + doc, _task_id = document_queue.pop() if doc.id and isinstance(doc.id, int): logger.debug( "_trigger_conversion_tasks() doc.id={doc_id}", diff --git a/src/abilian/sbe/apps/documents/tasks.py b/src/abilian/sbe/apps/documents/tasks.py index d71a699..fce2cb8 100644 --- a/src/abilian/sbe/apps/documents/tasks.py +++ b/src/abilian/sbe/apps/documents/tasks.py @@ -68,7 +68,7 @@ def process_document(document_id: int) -> None: document_id=document_id, ) - with get_document(document_id) as (session, document): + with get_document(document_id) as (_session, document): if document is None: return @@ -98,7 +98,7 @@ def _run_antivirus(document: Document) -> bool | None: @dramatiq.actor def antivirus_scan(document_id): """Return antivirus.scan() result.""" - with get_document(document_id) as (session, document): + with get_document(document_id) as (_session, document): if document is None: return None return _run_antivirus(document) @@ -108,7 +108,7 @@ def antivirus_scan(document_id): def preview_document(document_id: int) -> None: """Compute the document preview images with its default preview size.""" - with get_document(document_id) as (session, document): + with get_document(document_id) as (_session, document): logger.debug( "preview_document() document_id={document_id} document={document}", document_id=document_id, @@ -150,7 +150,7 @@ def convert_document_content(document_id: int) -> None: document_id=document_id, ) - with get_document(document_id) as (session, doc): + with get_document(document_id) as (_session, doc): if doc is None: # deleted after task queued, but before task run return diff --git a/src/abilian/sbe/apps/documents/webdav/views.py b/src/abilian/sbe/apps/documents/webdav/views.py index 7ffae6d..dcc5ff4 100644 --- a/src/abilian/sbe/apps/documents/webdav/views.py +++ b/src/abilian/sbe/apps/documents/webdav/views.py @@ -145,7 +145,7 @@ def mkcol(path): if parent_folder is None: return "Parent collection doesn't exist.", HTTP_CONFLICT, {} - new_folder = parent_folder.create_subfolder(name=name) + parent_folder.create_subfolder(name=name) db.session.commit() return "", HTTP_CREATED, {} @@ -231,7 +231,7 @@ def propfind(path): print(request.data) try: - propfind = Propfind(request.data) + Propfind(request.data) except XMLSyntaxError: return "Malformed XML document.", HTTP_BAD_REQUEST, {} diff --git a/src/abilian/sbe/apps/forum/tasks.py b/src/abilian/sbe/apps/forum/tasks.py index f7ef9b9..81c26c9 100644 --- a/src/abilian/sbe/apps/forum/tasks.py +++ b/src/abilian/sbe/apps/forum/tasks.py @@ -183,7 +183,7 @@ def extract_email_destination(address: str) -> tuple[str, ...]: address = m.group(1) local_part = address.rsplit("@", 1)[0] name, ident = local_part.rsplit("+", 1) - uid, digest = ident.rsplit("-", 1) + uid, _digest = ident.rsplit("-", 1) signed_local_part = build_local_part(name, uid) if local_part != signed_local_part: diff --git a/src/abilian/sbe/apps/social/views/invites.py b/src/abilian/sbe/apps/social/views/invites.py index 39042cc..ac00e18 100644 --- a/src/abilian/sbe/apps/social/views/invites.py +++ b/src/abilian/sbe/apps/social/views/invites.py @@ -42,12 +42,12 @@ def invite_post(): emails = [email.strip() for email in emails] # FIXME: what do we do with this ? - message = request.form.get("message", "") + _message = request.form.get("message", "") with mail.connect() as conn: for email in emails: # FIXME: what do we do with this ? - invite = Invite(sender=current_user, email=email) + _invite = Invite(sender=current_user, email=email) # subject = _(u"%s would like to invite you to the %s community") # % (current_user.name, "Yaka") diff --git a/src/abilian/sbe/apps/social/views/users.py b/src/abilian/sbe/apps/social/views/users.py index 16b3919..0f5d685 100644 --- a/src/abilian/sbe/apps/social/views/users.py +++ b/src/abilian/sbe/apps/social/views/users.py @@ -129,8 +129,8 @@ def users_dt_json(): cell1 = f'
' cell2 = age(user.created_at) cell3 = age(user.last_active) + _cell4 = "" # TODO: follow / unfollow? - cell4 = "" # TODO: follow / unfollow? data.append([cell0, cell1, cell2, cell3]) result = { diff --git a/src/abilian/services/auth/views.py b/src/abilian/services/auth/views.py index 4b58759..eb19624 100644 --- a/src/abilian/services/auth/views.py +++ b/src/abilian/services/auth/views.py @@ -207,7 +207,7 @@ def forgotten_pw(new_user: bool = False) -> str | Response | tuple[str, int]: @route("/reset_password/