compose/cmd
Nicolas De Loof 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 <noreply@anthropic.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2026-08-18 13:37:48 +02:00
..
cmdtrace golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
compatibility modernize some code 2026-02-12 15:31:35 +01:00
compose refactor: extract RootCommand's PersistentPreRunE concerns 2026-08-18 13:37:48 +02:00
display chore: inline needless single-use helpers 2026-08-14 22:49:53 +02:00
formatter feat(ps): add ENGINE column gated on label presence 2026-08-17 10:34:46 +02:00
prompt golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
main.go feat: add Docker Desktop Logs view hints and navigation shortcut 2026-04-10 15:26:08 +02:00