docs: keep neutral wording on every site page

The gaps page called each platform's file a corrected list, a word the
exports page test already kept off that page. The test now reads the
text of every site generator.
This commit is contained in:
Abdessamad Derraz committed 2026-10-21 05:06:37 +02:00
1 parent a0672d4459
commit fe652bf508
2 files changed
+38 -6

No files matched your search

+7 -6
View File
@@ -398,7 +398,7 @@ def generate_home(
"",
" Platform lists are checked against emulator source code, file "
"by file where a profile exists ([how far that reaches](gaps.md)). "
"Documentation and metadata can drift from actual runtime behavior, "
"Documentation and metadata can differ from actual runtime behavior, "
"so the source is the primary reference.",
"",
" 1. **Upstream emulator source**: what the original project "
@@ -1805,7 +1805,7 @@ def _render_platform_systems(
return lines
# Platforms with a corrected file published by export_native.py.
# Platforms with an updated file published by export_native.py.
_EXPORTED: set[str] = set()
@@ -2219,7 +2219,7 @@ def generate_provenance_page(
'orange (<span class="rb-badge rb-badge-warning">TOSEC</span>) where '
"TOSEC flags the dump as bad, overdumped, hacked, cracked or fixed. "
"Arcade ROM sets and engine data "
"sit outside what those catalogs index, so they are left out of the "
"sit outside what those catalogs index, so they are excluded from the "
"ratio rather than counted as failures.",
"",
"## What the badge means",
@@ -2861,7 +2861,7 @@ def _render_emulator_file(
details.append("Installed by the platform's own package on: "
+ ", ".join(sorted(f["installed_on"])))
if f.get("not_bundled_on"):
details.append("Left out by the platform's package, so the pack brings it, on: "
details.append("Not in the platform's package, so the pack brings it, on: "
+ ", ".join(sorted(f["not_bundled_on"])))
if f.get("unread_on"):
details.append("Never opened on these platforms, whose launcher names other files: "
@@ -3805,8 +3805,9 @@ def generate_gap_analysis(
"only authority for its files.",
"",
"The same comparison drives `scripts/exporter/`: each platform's "
"corrected list can be regenerated in its native format "
"(System.dat, es_bios.xml, batocera-systems.json, ...).",
"own file can be regenerated in its native format with these "
"differences applied (System.dat, es_bios.xml, "
"batocera-systems.json, ...).",
"",
])
+31
View File
@@ -80,5 +80,36 @@ class IconCacheIsReplacedWhole(unittest.TestCase):
atomic.assert_called_once()
class EveryPageAddressesPlatformsAsPeers(unittest.TestCase):
"""The exports page was held to neutral wording, and the gaps page next
to it still called each platform's file a "corrected list". Reads the
text every site generator writes, docstrings and bare identifiers aside."""
WORDS = ("their file", "theirs", "of ours", "corrected", "left out", "drift")
SOURCES = ("generate_site.py", "siterender.py", "sitesources.py", "siteexports.py")
def test_no_page_text_judges_another_project(self):
import ast
import re
found = []
for name in self.SOURCES:
tree = ast.parse((REPO_ROOT / "scripts" / name).read_text(encoding="utf-8"))
docstrings = {
id(node.body[0].value) for node in ast.walk(tree)
if isinstance(node, (ast.Module, ast.ClassDef, ast.FunctionDef,
ast.AsyncFunctionDef))
and ast.get_docstring(node, clean=False) is not None
}
for node in ast.walk(tree):
if (not isinstance(node, ast.Constant) or not isinstance(node.value, str)
or id(node) in docstrings or re.fullmatch(r"\w+", node.value)):
continue
text = node.value.lower()
found += [f"{name}:{node.lineno} {word!r}"
for word in self.WORDS if word in text]
self.assertEqual(found, [])
if __name__ == "__main__":
unittest.main()