mehcode / config-rs

⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).
Apache License 2.0
2.43k stars 206 forks source link

Revert "turn keys to lowercase to enable cross overrides" #543

Open matthiasbeyer opened 3 months ago

matthiasbeyer commented 3 months ago

This reverts commit d2ee90ea23281b057dffa6515b274e5c7b82cf87.

I am not 100% sure about this, but this might solve #531

@max-m @jpmckinney @vladgon can you test this change? CI fails for now but I am not entirely sure whether CI is right at this point :laughing: :sweat:

matthiasbeyer commented 3 months ago

Either way, tests are missing for this... so I'll mark this as help-wanted.

max-m commented 3 months ago

Hi, sorry for the delay. I did a quick test (loading my config and printing it).

Base case: config = { version = "0.13.4", default-features = false, features = [ "toml" ] } Uppercase keys are uppercase. :+1:

Latest upstream version: config = { version = "0.14", default-features = false, features = [ "toml" ] } Uppercase keys are lowercase. :-1:

This patch: config = { git = "https://github.com/matthiasbeyer/config-rs.git", rev = "69affb1255292047040852ff35c821a1be7f4c51", default-features = false, features = [ "toml" ] } Uppercase keys are uppercase. :+1:

matthiasbeyer commented 3 months ago

Cool. @YounessBird can you have a look? This obviously breaks a test and of course also that change that is reverted here was introduced for a reason... so I'd like to have you look at it to decide how we can or should moving forward.

oscargus commented 3 months ago

Just a friendly reminder to also revert this text in the README:

 - Is case insensitive and all the keys are converted to lowercase internally

(This is causing problems in my project where we read arbitrary key names from a config file and then use them in e.g. menus and commands, so one would like to keep the case.)

jpmckinney commented 3 months ago

Confirm works! Using config = { git = "https://github.com/matthiasbeyer/config-rs.git", rev = "69affb1255292047040852ff35c821a1be7f4c51", default-features = false, features = [ "ini" ] }