fix: text-based YAML patching preserves formatting

replace yaml.dump with surgical text edits for contents/source_ref.
preserves comments, block scalars, quoting, indentation.
fix FBNeo new entry detection using parsed keys instead of text search.
This commit is contained in:
Abdessamad Derraz
2026-03-30 21:35:41 +02:00
parent 75e34898ee
commit 427fef5669
2 changed files with 218 additions and 11 deletions

View File

@@ -269,8 +269,8 @@ def run(
diff = compute_diff(str(path), str(CACHE_PATH), mode='fbneo')
print(_format_diff(path.stem, diff, show_added=is_main))
if not dry_run and (diff['added'] or diff['updated']):
is_main = path.name == 'fbneo.yml'
effective_added = diff['added'] if is_main else []
if not dry_run and (effective_added or diff['updated']):
merge_fbneo_profile(str(path), str(CACHE_PATH), write=True, add_new=is_main)
log.info('merged changes into %s', path.name)