aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/tasks/scanner.py
diff options
context:
space:
mode:
authorDennis Fink2026-11-16 09:27:29 +0100
committerDennis Fink2026-11-16 09:27:29 +0100
commit85b10c38f39732421a230d938adddc7805d0e001 (patch)
tree396f29962fac45245c6f1486e188ad905588659d /webmentions_ssg/tasks/scanner.py
parenteb404d9a1a328278c92753e65100579e7ad98e48 (diff)
downloadwebmentions-ssg-85b10c38f39732421a230d938adddc7805d0e001.tar.gz
webmentions-ssg-85b10c38f39732421a230d938adddc7805d0e001.zip
style(core): reorder module declarations
Group globals and data classes near module imports, keep primary classes and functions together, and move implementation helpers after their public callers. Reorder Alembic setup so configuration happens after the required helpers are defined, without changing runtime behavior.
Diffstat (limited to '')
-rw-r--r--webmentions_ssg/tasks/scanner.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/webmentions_ssg/tasks/scanner.py b/webmentions_ssg/tasks/scanner.py
index fb0c770..6869477 100644
--- a/webmentions_ssg/tasks/scanner.py
+++ b/webmentions_ssg/tasks/scanner.py
@@ -20,6 +20,14 @@ from .sender import send_webmention
from .source_parser import ScannedSource, SourceScanError, scan_source_file
+@dataclass(frozen=True)
+class TreeScanResult:
+ """Count and discovered paths from a traversal of the source tree."""
+
+ scanned_count: int
+ seen_paths: frozenset[str]
+
+
def build_source(scanned: ScannedSource, scan_time: datetime) -> SourceDocument:
"""Build a source model from a newly discovered document.
@@ -118,14 +126,6 @@ def scan_sources() -> None:
_scan_and_enqueue()
-@dataclass(frozen=True)
-class TreeScanResult:
- """Count and discovered paths from a traversal of the source tree."""
-
- scanned_count: int
- seen_paths: frozenset[str]
-
-
def reconcile_source_tree(
root: Path,
base_url: str | None,