From 7aa93f4ad4229a9c597f8dd53f1acc0c92bedd1a Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Sat, 21 Nov 2026 14:31:23 +0100 Subject: [PATCH] refactor: settle fileless profiles by one rule --- scripts/profiling/fileless.py | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/scripts/profiling/fileless.py b/scripts/profiling/fileless.py index 8c1b73f6c..2a278552a 100644 --- a/scripts/profiling/fileless.py +++ b/scripts/profiling/fileless.py @@ -37,20 +37,7 @@ def audit( ) -> list[tuple[str, str]] | None: """Signals found in the sources a fileless profile cites.""" document = source_yaml_file(os.path.join(emulators_dir, f"{name}.yml")) or {} - if document.get("files"): - return None - if document.get("type") == "alias": - # The same binary under another name: its files are its target's. - return None - if str(document.get("exclusion_note") or "").strip(): - # Someone read this one and wrote down why nothing is declared. The - # check exists to find the profiles nobody has answered yet, and an - # answer that goes stale shows up as a drifting ref instead. - return None - if document.get("data_directories"): - # The load is declared, as a directory rather than a file. dinothawr - # reads system_dir/dinothawr/ and says so there. That is coverage, not - # an assertion waiting to age. + if settled_before_reading(document): return None views = select_views(document, cache_dir, offline) if not views: @@ -70,12 +57,18 @@ def audit( def settled_before_reading(document: dict) -> bool: - """A profile answered without its sources: files, an exclusion note, or - a declared data directory (see audit).""" + """A profile answered without reading its sources.""" return bool( document.get("files") + # The same binary under another name: its files are its target's. or document.get("type") == "alias" + # Someone read this one and wrote down why nothing is declared. The + # check exists to find the profiles nobody has answered yet, and an + # answer that goes stale shows up as a drifting ref instead. or str(document.get("exclusion_note") or "").strip() + # The load is declared, as a directory rather than a file. dinothawr + # reads system_dir/dinothawr/ and says so there. That is coverage, not + # an assertion waiting to age. or document.get("data_directories") )