You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An ordered map would make, for example, the relink hash tables execute in order, which would present clearer output. It would also help when reviewing the output log to see what was was, when, and what may have been missed.
It would be nice to support this for both JSON and YAML, do it by default, and not have any syntactic overhead in the configuration files.
It looks like this is possible [1, 2]. And it looks like with Python 3.7+ and PyYAML, order is preserved by default [3, 4]. We should be able to find some clean solution that works across the Python versions supported by Dotbot.
If anyone wants to work on this, I'm happy to review a PR, otherwise I'll get around to implementing this sometime soon.
On second thought: I don't think it's worth the additional complexity involved in implementing this functionality in a backward-compatible way. Especially since I think people shouldn't rely on this behavior for correctness, only for readability of the output, so it's not critical if it doesn't work on some platforms.
Even though Dotbot will continue to support Python 2.7 and Python 3.4+ for the foreseeable future, Python 2 has been sunset, and PyYAML on Python 3.7+ already has this behavior of preserving order.
An ordered map would make, for example, the
relink
hash tables execute in order, which would present clearer output. It would also help when reviewing the output log to see what was was, when, and what may have been missed.The YAML syntax looks basically like this:
I believe support would need to be added in config.py.
As an aside, this would likely be a YAML-only feature. There doesn't appear to be support provided by the default JSON parsers.
The text was updated successfully, but these errors were encountered: