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/scanner.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'webmentions_ssg/tasks/scanner.py') 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()) -- cgit v1.3.1