refactor: one copy of each duplicated helper

This commit is contained in:
Abdessamad Derraz committed 2026-11-18 22:16:55 +01:00
1 parent 2c8a9cfad8
commit 238f70c7a7
11 files changed
+49 -79

No files matched your search

+2 -4
View File
@@ -15,6 +15,8 @@ import re
from collections.abc import Callable, Iterable
from dataclasses import dataclass, field
from model.sourceref import span
from .base_scraper import fetch_bytes, github_headers
from .configgen_launchers import LauncherShapeError
@@ -33,10 +35,6 @@ class LauncherPatternMissing(LauncherShapeError):
super().__init__(f"{path}: {what} not found")
def span(first: int, last: int) -> str:
return str(first) if first == last else f"{first}-{last}"
def merge_lines(lines: Iterable[int]) -> list[tuple[int, int]]:
"""Line numbers as sorted spans, a gap of one line joined."""
spans: list[tuple[int, int]] = []