mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-12-02 14:28:54 -06:00
refactor: one list of files the pipeline rewrites
diskcleanup kept its own regex of generated paths and missed derivable.json, retired.json and wiki/installer.md, so a worktree holding only a pipeline run's output was kept as uncommitted code. core.generated holds the globs, the cleanup and the nightly's commit rules match with them, and a test ties the regenerate rule to the list. The rule gains install/standalone/*.json and wiki/reading-reports.md, which the pipeline writes and no rule committed.
This commit is contained in:
1 parent
2a3b55432b
commit
f379df5e1e
6 files changed
+82
-28
No files matched your search
@@ -4,19 +4,15 @@ from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
from collections.abc import Iterable
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
from core.generated import is_generated
|
||||
from core.paths import AUTORUN_WORKTREE
|
||||
|
||||
GENERATED = re.compile(
|
||||
r"^(database\.json|install/.*\.json|exports/.*\.json|README\.md|CONTRIBUTING\.md"
|
||||
r"|website/src/data/[^/]+\.json)$"
|
||||
)
|
||||
KEPT_TMP = ("acquire",)
|
||||
ALERT_GB = 100
|
||||
|
||||
@@ -80,7 +76,7 @@ def real_changes(worktree: Path) -> list[str]:
|
||||
if len(line) < 4 or line[:2].strip() == "D":
|
||||
continue
|
||||
path = line[3:].split(" -> ")[-1].strip('"')
|
||||
if not GENERATED.match(path):
|
||||
if not is_generated(path):
|
||||
paths.append(path)
|
||||
return paths
|
||||
|
||||
|
||||
Reference in new issue
Block a user