[Library] improve handling of dangling refs

This commit is contained in:
Jan Petykiewicz 2026-03-30 22:10:26 -07:00
commit 20bd0640e1
3 changed files with 183 additions and 22 deletions

View file

@ -75,7 +75,8 @@ def preflight(
raise PatternError('Non-numeric layers found:' + pformat(named_layers))
if prune_empty_patterns:
pruned = lib.prune_empty()
prune_dangling = 'error' if allow_dangling_refs is False else 'ignore'
pruned = lib.prune_empty(dangling=prune_dangling)
if pruned:
logger.info(f'Preflight pruned {len(pruned)} empty patterns')
logger.debug('Pruned: ' + pformat(pruned))