feat: commit the corrected file of each platform

exports/ now holds the twelve platforms' own files, corrected, with a
report of every change, read by the site's corrected files page. Two
summaries are reworded for the page: an addition the format cannot
carry is counted as left out, and RetroPie names each skipped package
by sentence instead of joining reasons with semicolons. Its parser no
longer reads "e.g" as a file name.
This commit is contained in:
Abdessamad Derraz committed 2026-10-20 09:26:12 +02:00
1 parent b3b3880c19
commit b6a1304893
39 files changed
+32056 -7

No files matched your search

+4 -4
View File
@@ -374,9 +374,9 @@ class LandedChanges:
requirements: int = 0
def _count(number: int, noun: str) -> str:
def _count(number: int, noun: str, plural: str = "") -> str:
""""1 hash", "2 hashes": a count with its noun in the right number."""
plural = noun + ("es" if noun.endswith(("sh", "ch", "s", "x")) else "s")
plural = plural or noun + ("es" if noun.endswith(("sh", "ch", "s", "x")) else "s")
return f"{number} {noun if number == 1 else plural}"
@@ -529,9 +529,9 @@ def export_platform(
if cleared:
summary += f", {_count(len(cleared), 'hash')} cleared"
if refused:
summary += f", {refused} the format cannot state"
summary += f", {_count(refused, 'addition')} left out"
if lost:
summary += f", {lost} of theirs dropped"
summary += f", {_count(lost, 'entry', 'entries')} of theirs the format drops"
withheld = exporter.withheld()
if withheld:
summary += f", {_count(len(withheld), 'correction')} withheld"
+5 -3
View File
@@ -42,6 +42,8 @@ MAX_NAMES = 6
_MODULE_ID = re.compile(r'rp_module_id="([^"]+)"')
_MODULE_HELP = re.compile(r'rp_module_help="((?:[^"\\]|\\.)*)"')
_FILENAME = re.compile(r"[A-Za-z0-9][\w.+-]*\.[A-Za-z0-9]{1,5}\b")
# fs-uae's help reads "(e.g, kick13.rom)": e.g and i.e have a file name's shape.
_ABBREVIATION = re.compile(r"[a-z]\.[a-z]", re.I)
# RetroPie words the instruction several ways ("Copy the required BIOS files
# a.bin and b.bin to $biosdir", "The Sega CD requires the BIOS files a.bin,
# b.bin copied to $biosdir"), so the clause is found by the word BIOS rather
@@ -131,7 +133,7 @@ class Exporter(BaseExporter):
found: list[re.Match[str]] = []
for match in _FILENAME.finditer(text):
before = text[match.start() - 1 : match.start()]
if before in (".", "/", "\\"):
if before in (".", "/", "\\") or _ABBREVIATION.fullmatch(match.group(0)):
continue
found.append(match)
return found
@@ -369,8 +371,8 @@ class Exporter(BaseExporter):
shown = ", ".join(sorted(modules)[:4])
if len(modules) > 4:
shown += f" and {len(modules) - 4} more"
parts.append(f"{len(modules)} {reason} ({shown})")
return "; ".join(parts)
parts.append(f"{shown}: {reason}")
return ". ".join(parts)
def validate(
self,
+5
View File
@@ -77,6 +77,11 @@ def generate_exports_page(reports: list[dict], names: dict[str, str]) -> str:
"so a maintainer can diff it against theirs and take the changes "
"line by line.",
"",
"A file the emulators read and the list lacks is added only when the "
"format can carry it. Most platforms check an md5, so a file whose "
"source states no md5 is left out, and so is one filed under a system "
"the platform's checker never reads. Those are counted as left out.",
"",
]
if not reports:
lines.extend([