aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/tasks/mentions.py
diff options
context:
space:
mode:
authorDennis Fink2026-11-12 22:07:12 +0100
committerDennis Fink2026-11-12 22:07:12 +0100
commitc7993952c585b66acad5275e39dbf91cf662b975 (patch)
tree976b3746444b3bd0bbb269bef9197c8b6a2e1696 /webmentions_ssg/tasks/mentions.py
parentb930b4425b91aa42abcec6c3443685065a5ca242 (diff)
downloadwebmentions-ssg-c7993952c585b66acad5275e39dbf91cf662b975.tar.gz
webmentions-ssg-c7993952c585b66acad5275e39dbf91cf662b975.zip
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.
Diffstat (limited to '')
-rw-r--r--webmentions_ssg/tasks/mentions.py7
1 files changed, 2 insertions, 5 deletions
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.