Skip to content

feat(cli): load comparison defaults from .hclexp.config - #244

Merged
orian merged 1 commit into
mainfrom
feat/hclexp-config
Sep 8, 2026
Merged

feat(cli): load comparison defaults from .hclexp.config#244
orian merged 1 commit into
mainfrom
feat/hclexp-config

Conversation

@orian

@orian orian commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add HCL .hclexp.config files with global, diff, drift, plan, and web sections
  • load $HOME/.hclexp.config first and the exact working-directory file second; no parent traversal
  • resolve precedence as built-in < home global < home command < workdir global < workdir command < explicit CLI
  • preserve explicit boolean overrides in both directions, including -ignore-column-order=false
  • apply ignore_column_order to diff, drift, plan, and dump-mode web
  • print every loaded config path to stderr only when stderr is a terminal
  • fail closed on malformed HCL, unknown settings, and unknown command blocks
  • document the file format, lookup rules, precedence, and output behavior

Tests

  • unit tests for HOME/workdir layering, global/command precedence, deduplication, invalid and unknown input, CLI precedence, and terminal-only status output
  • end-to-end coverage for diff, plan -dump, drift, and web -dump
  • end-to-end coverage for explicit true/false overrides, HOME discovery, invalid config, clean JSON, and clean redirected output
  • existing subprocess E2Es isolated from developer-local config
  • go test ./...
  • go test -race ./internal/... ./cmd/...
  • go vet ./...
  • go build ./...

Closes #242.

@orian
orian merged commit ee62a6d into main Sep 8, 2026
16 checks passed
@orian
orian deleted the feat/hclexp-config branch September 8, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI: load comparison defaults from .hclexp.config

1 participant