mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-18 09:23:26 -05:00
fix: cite primehack's Realtek loader at its pin
A comment named the Bluetooth directory twice, a path no revision holds, and every firmware ref sat ten lines above the case it meant. Each now cites its case and return at the pinned commit. The schema check reads profiles as text and refuses a citation that repeats its own directories.
This commit is contained in:
1 parent
35c067fcc0
commit
0450ab1b72
3 files changed
+73
-16
No files matched your search
@@ -59,6 +59,7 @@ def _validate_yaml_directory(
|
||||
out.extend(_unreachable_citations(path, data))
|
||||
if schema_name == "emulator.schema.json":
|
||||
out.extend(_checks_without_values(path, data))
|
||||
out.extend(_doubled_paths(path))
|
||||
return out
|
||||
|
||||
|
||||
@@ -202,6 +203,27 @@ def _unreachable_citations(path: Path, document: object) -> list[str]:
|
||||
return out
|
||||
|
||||
|
||||
_DOUBLED_PATH = re.compile(r"((?:[\w.-]+/){2,})\1")
|
||||
|
||||
|
||||
def _doubled_paths(path: Path) -> list[str]:
|
||||
"""A citation whose directory is written twice in a row.
|
||||
|
||||
Read from the raw text, comments included: primehack's note on the
|
||||
Realtek loader cited Source/Core/Core/IOS/USB/Bluetooth/ twice over, a
|
||||
path no revision holds, in a comment the parsed document never shows.
|
||||
"""
|
||||
out: list[str] = []
|
||||
for number, line in enumerate(path.read_text(encoding="utf-8").splitlines(), 1):
|
||||
match = _DOUBLED_PATH.search(line)
|
||||
if match:
|
||||
out.append(
|
||||
f"{path.relative_to(ROOT)}:{number}: citation repeats its "
|
||||
f"directory: {match.group(1)}"
|
||||
)
|
||||
return out
|
||||
|
||||
|
||||
def _unknown_data_dir_refs() -> list[str]:
|
||||
"""data_directories refs the registry does not define.
|
||||
|
||||
|
||||
Reference in new issue
Block a user