-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make list config optional? #213
Comments
or perhaps it should be implemented wherever the config is read. |
I agree that it would be nice to be able to omit the unnecessary-looking I'd be open to having this as a feature, as long as we could implement it in a way that's consistent with all Python versions that we aim to be compatible with. |
So the underlying issue is finding a way to parse the YAML/JSON into an ordered dict? Are you open to switching from pyyaml to another yaml library? |
Yes, and doing it in a clean way that's compatible with all Python versions, and guaranteed by the spec of the YAML parser (not just "it happens to work"). I'd prefer not to switch libraries (are there even any other high-quality Python YAML parsing libraries?) |
None that I've heard of, but I'll look into it when I get a chance. |
ruamel.yaml is pretty high quality (docs), and maintains order of dicts and such (comments too if dumping) across python versions (i.e. uses collections.OrderedDict instead of default Python 3.6+ dict ordering). |
I may be missing something but from what i've read on pyyaml#110 it is ordered when reading you should just use an |
From a quick skim, it looks like pyyaml will do the right thing on Python 3.7+, where dictionaries are ordered by the language spec, but I don't think pyyaml will guarantee this behavior with earlier versions of Python. |
This is a tough call, omitting the |
I understand the reason for a config being a list, but in my case I don't really need to specify a directive more than once in the config. Because of this, having to prefix every directive with
-
seems unnecessary.Thus I suggest allowing simple hash based configs, ergo turning:
into:
I believe this should be pretty easy to implement in
dotbot/cli.py
using the following diff.The text was updated successfully, but these errors were encountered: