Files
compose/cmd
Nicolas De LoofandClaude Fable 5 e964454893 refactor: extract RootCommand's PersistentPreRunE concerns
RootCommand (cognitive complexity 62) buried four independent
concerns inside the PersistentPreRunE closure, where every branch
costs double. Each moves to a named function: runParentPreRun (cobra
doesn't chain the parent's PersistentPreRunE automatically),
resolveAnsiMode (--ansi vs deprecated --no-ansi vs COMPOSE_ANSI),
applyDisplayMode (ANSI + NO_COLOR + progress mode),
normalizeProjectOptions (--workdir deprecation, env-file paths) and
resolveMaxConcurrency (COMPOSE_PARALLEL_LIMIT vs --parallel). The
prerun now reads as the sequence of those steps; RootCommand drops to
complexity 22 and its FIXME suppression is gone.

No behavior change: same errors, same deprecation warnings, same
precedence rules.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Nicolas De Loof <[email protected]>
2026-08-18 13:37:48 +02:00
..
2026-02-12 15:31:35 +01:00