aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/tasks/scanner.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/scanner.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 'webmentions_ssg/tasks/scanner.py')
-rw-r--r--webmentions_ssg/tasks/scanner.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/webmentions_ssg/tasks/scanner.py b/webmentions_ssg/tasks/scanner.py
index 1b1c6ef..6365ff9 100644
--- a/webmentions_ssg/tasks/scanner.py
+++ b/webmentions_ssg/tasks/scanner.py
@@ -21,8 +21,7 @@ from .source_parser import ScannedSource, SourceScanError, scan_source_file
def create_source(scanned: ScannedSource, scan_time: datetime) -> Source:
- """
- Create a source model from a newly discovered document.
+ """Create a source model from a newly discovered document.
A sent Webmention is created for each discovered target at the initial source
revision.
@@ -52,8 +51,7 @@ def create_source(scanned: ScannedSource, scan_time: datetime) -> Source:
def update_source(
source: Source, scanned: ScannedSource, scan_time: datetime
) -> Source:
- """
- Update an existing source from newly scanned data.
+ """Update an existing source from newly scanned data.
A changed or previously deleted source receives a new revision. Existing sent
Webmentions are updated to reflect the current targets, and newly discovered
@@ -103,8 +101,7 @@ def update_source(
def scan_sources() -> None:
- """
- Scan generated source documents and queue pending Webmentions.
+ """Scan generated source documents and queue pending Webmentions.
New and changed sources are persisted, missing sources are marked as deleted,
and Webmentions requiring processing are queued for sending. A scan that
@@ -157,7 +154,7 @@ def scan_sources_task() -> None:
for index_path in root.rglob("index.html"):
relative_path = index_path.relative_to(root)
- if relative_path.parent == Path("."):
+ if relative_path.parent == Path():
continue
seen_paths.add(relative_path.as_posix())