jj/lib
Yuya Nishihara dc9caa5b0a config: add function to resolve conditional tables
This provides an inline version of Git's includeIf. The idea is that each config
layer has an optional key "--when" to enable the layer, and a layer may have
multiple sub-layer tables "--scope" to inline stuff. Layers can be nested, but
that wouldn't be useful in practice.

I choose "--" prefix to make these meta keys look special (and are placed
earlier in lexicographical order), but I don't have strong opinion about that.
We can use whatever names that are unlikely to conflict with the other config
sections.

resolve() isn't exported as a StackedConfig method because it doesn't make
sense to call resolve() on "resolved" StackedConfig. I'll add a newtype in
CLI layer to distinguish raw config from resolved one. Most consumers will
just see the "resolved" config.

#616
2024-12-19 11:09:02 +09:00
..
benches style: add semicolon at the end of expressions used as statements 2024-10-04 22:29:13 +02:00
gen-protos cargo: inherit lints configuration from workspace 2024-10-04 22:29:13 +02:00
proc-macros style: remove useless uses of .iter() 2024-10-04 22:29:13 +02:00
src config: add function to resolve conditional tables 2024-12-19 11:09:02 +09:00
tests settings: parse TOML date-time value as well as string timestamp 2024-12-18 09:51:56 +09:00
testutils settings: propagate error from UserSettings::from_config() 2024-12-18 09:51:56 +09:00
Cargo.toml cargo: drop dependency on config crate 2024-12-10 16:08:50 +09:00
LICENSE