mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-12-02 06:18:51 -06:00
refactor: tidy the repository root
README.md and CONTRIBUTING.md open with a comment naming their generator, generate_readme.py --check fails on a hand edit in validate.yml and pr_checks.py, and .gitattributes marks the pipeline outputs as generated, held equal to core/generated.py by a test. _mame_clones.json becomes mame_clones.json, still written beside the scanned bios/ tree, and now triggers both workflows (coverage reads it). docs_assets/ moves to website/assets/, which Astro does not read as content. ACCESSIBILITY.md becomes wiki/accessibility.md, linked from the README and the installer page. The screenshot list moves to wiki/images-wanted.md: nothing read docs_assets/screens/. The architecture map names every root entry (test_repository_map), platforms/README.md keeps only what this folder holds, the reference index lists archive-recipes and measurements, and reference-terms no longer defines Profile twice nor repeats the glossary's Pack.
This commit is contained in:
1 parent
5e306ec19f
commit
ab7e300c19
283 files changed
+410
-193
No files matched your search
+14
-10
@@ -41,6 +41,18 @@ def json_text(value: object) -> str:
|
||||
return str(value)
|
||||
|
||||
|
||||
def content_differs(
|
||||
path: str, content: str, normalize: Callable[[str], str] | None = None
|
||||
) -> bool:
|
||||
"""Whether path is absent or holds other content once timestamp lines are stripped."""
|
||||
if not os.path.exists(path):
|
||||
return True
|
||||
with open(path) as f:
|
||||
existing = f.read()
|
||||
before, after = (normalize(existing), normalize(content)) if normalize else (existing, content)
|
||||
return _strip_timestamps(before) != _strip_timestamps(after)
|
||||
|
||||
|
||||
def write_if_changed(
|
||||
path: str, content: str, normalize: Callable[[str], str] | None = None
|
||||
) -> bool:
|
||||
@@ -54,16 +66,8 @@ def write_if_changed(
|
||||
part it owns. Without it the second pass always sees a difference, the
|
||||
file is rewritten, and the fresh timestamp defeats the comparison.
|
||||
"""
|
||||
if os.path.exists(path):
|
||||
with open(path) as f:
|
||||
existing = f.read()
|
||||
before, after = (
|
||||
(normalize(existing), normalize(content))
|
||||
if normalize
|
||||
else (existing, content)
|
||||
)
|
||||
if _strip_timestamps(before) == _strip_timestamps(after):
|
||||
return False
|
||||
if not content_differs(path, content, normalize):
|
||||
return False
|
||||
write_text_atomic(path, content)
|
||||
return True
|
||||
|
||||
|
||||
Reference in new issue
Block a user