From c7993952c585b66acad5275e39dbf91cf662b975 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Thu, 12 Nov 2026 22:07:12 +0100 Subject: chore(core): enable stricter Ruff lint rules Expand Ruff checks for bugbear, complexity, pathlib, return statements, simplifications, upgrades, and docstring style. Apply the resulting behavior-neutral cleanup across application and test code. --- webmentions_ssg/tasks/mentions.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'webmentions_ssg/tasks/mentions.py') diff --git a/webmentions_ssg/tasks/mentions.py b/webmentions_ssg/tasks/mentions.py index 4e5a5ca..42dd0b6 100644 --- a/webmentions_ssg/tasks/mentions.py +++ b/webmentions_ssg/tasks/mentions.py @@ -31,8 +31,7 @@ HTML_URL_ATTRIBUTES = { def html_mentions_target(body: bytes, source_url: str, target_url: str) -> bool: - """ - Check whether an HTML document mentions the target URL. + """Check whether an HTML document mentions the target URL. URL references are resolved against the document's ``base`` element when present, or against the source URL otherwise. @@ -42,7 +41,6 @@ def html_mentions_target(body: bytes, source_url: str, target_url: str) -> bool: :param target_url: Exact URL to look for. :return: Whether a supported HTML URL attribute references the target URL. """ - document = BeautifulSoup(body, "html.parser") base_url = source_url @@ -67,8 +65,7 @@ def html_mentions_target(body: bytes, source_url: str, target_url: str) -> bool: def text_mentions_target(body: str, target_url: str) -> bool: - """ - Check whether plain text contains the target IRI, ignoring trailing prose + """Check whether plain text contains the target IRI, ignoring trailing prose punctuation but not extra URL path or query characters. :param body: Plain-text document body. -- cgit v1.3.1