Hi @dbatten5
If I provide a configuration as an ini-file, the configuration sections are parsed and the keys are put under that section (nested) within the config_dict.
return {section: dict(config.items(section)) for section in config.sections()}
^^^^^<----- nested keys in section
https://github.com/dbatten5/maison/blob/main/src/maison/config_sources/ini_source.py#L20
If I want to configure top-level config options, I would assume, that I would need to provide them within the [DEFAULT]
section, but those configs are only parsed as the default values within a section - no top level config is created.
I would propose to either use the same section-name as in the pyproject.toml or to parse the default-section values with config.defaults()
. If I define defaults, those values are also merged with the section values as well. E.g.:
yamlfix.ini
[DEFAULT]
quote_representation = "'"
quote_basic_values = "true"
[yamlfix]
test = "test"
would currently be parsed to this dictionary:
{
"yamlfix": {
"test": "test",
"quote_representation": "'",
"quote_basic_values": "true"
}
}
but I would expect this:
{
"quote_representation": "'",
"quote_basic_values": "true",
"yamlfix": {
"test": "test",
"quote_representation": "'",
"quote_basic_values": "true"
}
or with the same handling as pyproject.toml
(section header == project_name):
{
"test": "test",
"quote_representation": "'",
"quote_basic_values": "true"
}