feat(config): loader core - ResolveConfig (config phase B3) - #91
Merged
Conversation
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
enabled auto-merge (squash)
June 23, 2026 00:16
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:Sourceenum {unset, system, user, project, cli}; CLI is applied by the caller (wins)..xffrcline applies when itsbaseis empty/commonor names an active--config, AND itsconfigis empty or names one.--no-configyields 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:configgating 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.ccwiring -> C policy gate -> D styles/features (#54) -> E argv[0]+explain (#59).