compose/cmd/compose
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
..
alpha.go Setup Compose service using functional parameters 2025-10-24 18:24:21 +02:00
attach.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
backend.go refactor: fix lint issues from cleanup changes 2026-05-12 11:31:40 +02:00
bridge.go fix(bridge): validate arguments of bridge subcommands 2026-08-13 11:45:46 +02:00
bridge_test.go fix(bridge): validate arguments of bridge subcommands 2026-08-13 11:45:46 +02:00
build.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
commit.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
completion.go fix: tolerate missing env file on scale, watch and shell completion 2026-07-30 11:38:47 +02:00
compose.go refactor: extract RootCommand's PersistentPreRunE concerns 2026-08-18 13:37:48 +02:00
compose_oci_test.go Fix invalid path error when using OCI artifacts on Windows 2026-02-09 09:15:37 +01:00
compose_progress_test.go fix(progress): probe stderr (not stdout) for TTY auto-detection 2026-06-15 14:17:07 +02:00
compose_test.go update compose-go to version using immutable Project functions 2024-01-11 10:44:42 +01:00
config.go chore: inline needless single-use helpers 2026-08-14 22:49:53 +02:00
config_test.go fix(config): pin type:image volume sources and pre_start hook images 2026-07-24 15:33:21 +02:00
cp.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
create.go chore: inline needless single-use helpers 2026-08-14 22:49:53 +02:00
down.go add service name completion to down command 2026-01-05 09:32:39 +01:00
events.go fix(events): validate service names before subscribing to events 2026-08-18 10:48:59 +02:00
exec.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
export.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
generate.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
hooks.go feat: pre-filter Desktop Logs view by Compose project 2026-05-18 17:28:03 +02:00
hooks_test.go feat: pre-filter Desktop Logs view by Compose project 2026-05-18 17:28:03 +02:00
images.go go.mod: bump github.com/moby/moby/api v1.53.0, moby/client v0.2.2 2026-02-11 12:32:37 +01:00
kill.go refactor: fix lint issues from cleanup changes 2026-05-12 11:31:40 +02:00
list.go chore: inline needless single-use helpers 2026-08-14 22:49:53 +02:00
logs.go docs: compose logs: add more links for flag descriptions 2026-06-10 09:36:31 +02:00
options.go chore: inline needless single-use helpers 2026-08-14 22:49:53 +02:00
options_test.go Skip validation when extracting config variables 2026-06-12 15:34:20 +02:00
pause.go refactor: fix lint issues from cleanup changes 2026-05-12 11:31:40 +02:00
port.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
ps.go lint: replace gocyclo with gocognit 2026-08-18 10:42:37 +02:00
publish.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
pull.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
pullOptions_test.go update compose-go to version using immutable Project functions 2024-01-11 10:44:42 +01:00
push.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
remove.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
restart.go refactor: fix lint issues from cleanup changes 2026-05-12 11:31:40 +02:00
run.go fix: address image-identity review findings 2026-08-13 12:03:29 +02:00
scale.go chore: honest name for navigation-menu resolution, share setServiceScale 2026-08-14 22:49:53 +02:00
start.go refactor: fix lint issues from cleanup changes 2026-05-12 11:31:40 +02:00
stats.go go.mod: bump github.com/moby/moby/api v1.53.0, moby/client v0.2.2 2026-02-11 12:32:37 +01:00
stop.go refactor: fix lint issues from cleanup changes 2026-05-12 11:31:40 +02:00
top.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
top_test.go fix mixed assertion libraries in tests 2026-03-31 17:32:51 +02:00
up.go lint: replace gocyclo with gocognit 2026-08-18 10:42:37 +02:00
up_test.go test: cover up remote-stack variable prompt 2026-06-12 15:34:20 +02:00
version.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
version_test.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
viz.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
viz_test.go fix mixed assertion libraries in tests 2026-03-31 17:32:51 +02:00
volumes.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
wait.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
watch.go fix: tolerate missing env file on scale, watch and shell completion 2026-07-30 11:38:47 +02:00