Describe your use-case
Hi again.
I implemented a library on top of configupdater and someone reported it didn't work with EditorConfig configuration files. This is because such file can contain "global" properties which declared before any section:
root = true
[section]
foo = bar
baz = 42
There are no definitive specifications on the acceptable syntax of an INI file. In that respect, configupdater is consistent with configparser since both reject such file and raise MissingSectionHeaderError error.
Given that there are certain variants of the INI format that accept global parameters (also Apache), what do you think about extending configupdater support to such files?
Describe the solution you would like to see for your use-case
I imagine a new option to the ConfigUpdater class, such as allow_global_parameters defaulting to False. If True, the global parameters would be added to a section with None name or something like that.
I can try to open a PR if you're interested with such feature (don't know how technically feasible it is yet).
Otherwise, I'll just hack a workaround in my own library. But since it may be beneficial to others, I wanted to discuss it upstream first.
Describe your use-case
Hi again.
I implemented a library on top of
configupdaterand someone reported it didn't work with EditorConfig configuration files. This is because such file can contain "global" properties which declared before any section:There are no definitive specifications on the acceptable syntax of an INI file. In that respect,
configupdateris consistent withconfigparsersince both reject such file and raiseMissingSectionHeaderErrorerror.Given that there are certain variants of the INI format that accept global parameters (also Apache), what do you think about extending
configupdatersupport to such files?Describe the solution you would like to see for your use-case
I imagine a new option to the
ConfigUpdaterclass, such asallow_global_parametersdefaulting toFalse. IfTrue, the global parameters would be added to a section withNonename or something like that.I can try to open a PR if you're interested with such feature (don't know how technically feasible it is yet).
Otherwise, I'll just hack a workaround in my own library. But since it may be beneficial to others, I wanted to discuss it upstream first.