Skip to content

feat(config): loader core - ResolveConfig (config phase B3) - #91

Merged
helly25 merged 1 commit into
mainfrom
feat/config-loader-core
Jun 23, 2026
Merged

feat(config): loader core - ResolveConfig (config phase B3)#91
helly25 merged 1 commit into
mainfrom
feat/config-loader-core

Conversation

@helly25

@helly25 helly25 commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Third slice of the config loader (#58), per docs/design-config.md.

What

xff/config/config.{h,cc} - ResolveConfig(inputs) combines the parsed layers (system [defaults] + user/project .xffrc) into a precedence-ordered, provenance-tagged flag list:

  • Source enum {unset, system, user, project, cli}; CLI is applied by the caller (wins).
  • An .xffrc line applies when its base is empty/common or names an active --config, AND its config is empty or names one.
  • --no-config yields empty (pure CLI + built-ins); the system policy is never dropped here.

No discovery (file IO) or capability gating yet - the next slice wires discovery + run.cc, and phase C adds the policy gate.

Tests

no-config, system-defaults precedence, common/bare lines, base + base:config gating by active --config, and the system<user<project order. Green on default + --config=clang --config=asan; clang-format + no-em-dash clean.

Roadmap: B1, B2 (done) -> B3 (this) -> B4 discovery+run.cc wiring -> C policy gate -> D styles/features (#54) -> E argv[0]+explain (#59).

Third slice of the config loader (#58), per docs/design-config.md. xff/config/config.{h,cc}: ResolveConfig combines the parsed layers (system [defaults] + user/project .xffrc) into a precedence-ordered, provenance-tagged flag list (Source: unset/system/user/project/cli). An .xffrc line applies when its base selector is empty/common or names an active --config, and its config selector is empty or names one. --no-config yields empty (pure CLI + built-ins); the system policy is never dropped here.

No discovery (file IO) or capability gating yet - those are the next slice and phase C. Tests cover no-config, system-defaults precedence, common/bare lines, base + base:config gating by active --config, and the system<user<project layer order.
@helly25
helly25 enabled auto-merge (squash) June 23, 2026 00:16
@helly25
helly25 merged commit aac0303 into main Jun 23, 2026
5 checks passed
@helly25
helly25 deleted the feat/config-loader-core branch June 23, 2026 00:24
helly25 added a commit that referenced this pull request Jul 3, 2026
…) (#220)

New xff/color module resolves the --color=WHEN globals (last wins; bare
--color == always) and decides whether to emit ANSI SGR escapes by
combining the mode with isatty(stdout) and NO_COLOR (auto colors only a
tty with NO_COLOR unset; always overrides NO_COLOR). CodeForType maps the
filesystem file type to an ls/fd-like SGR parameter (directory bold blue,
symlink bold cyan, executable bold green, fifo/socket/device, ...); a
plain regular file stays uncolored.

render::Renderer::Record gains an optional color arg that wraps the kPlain
path body in \e[<code>m...\e[0m; kNul and kJsonl stay uncolored by design.
run.cc resolves colorize once (kPlain + enabled) and passes the per-entry
type code on the implicit-print path.

Self-doc: --color GlobalFlag (Output group), kHelpText line, TODO.md note.
Tests: color_test (unit), run_test e2e (always forces, auto stays plain
off-tty, plain files uncolored), color_test.sh binary-level.
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.

1 participant