mackup icon indicating copy to clipboard operation
mackup copied to clipboard

Migrate from `ini` to `yaml`

Open lra opened this issue 5 years ago • 8 comments

  1. Migrate
  2. Validate with https://github.com/23andMe/Yamale

lra avatar Aug 12 '19 07:08 lra

If I can offer my opinion here, yaml can burn in hell.

pvinis avatar Aug 26 '19 09:08 pvinis

Any constructive alternative? I have to hack the INI format to support lists, which yaml does out of the box.

lra avatar Aug 26 '19 21:08 lra

Oh I didn't know you faced limitations with ini. json5 is nice, and I guess yaml would also work. It just always feels easy to break or write in a wrong way because of the significant whitespace.

pvinis avatar Aug 27 '19 08:08 pvinis

how about toml ? I don't personally like it a lot however it it supports what you need and very much like ini

reference: https://github.com/toml-lang/toml

kdabir avatar Sep 25 '19 03:09 kdabir

+1 yaml, its simple and easy to read

dreed47 avatar Oct 16 '19 21:10 dreed47

Hello, is this TODO still active? I would like to try working on this.

Also, +1 for toml. Almost the same syntax, with additional features

Kemystra avatar Aug 02 '22 13:08 Kemystra

Yes, it's still active, but before starting any implementation, we should agree on a format, to leverage some toml features without making it too complex.

lra avatar Aug 02 '22 15:08 lra

This is a big breaking change, I agree that it would be best to agree on a format that keeps things simple. Here are some of my thoughts.

  1. ini has felt very strait-forward but feels limited, I agree that a better language that offers schema validation would improve the project overall.
[application]
name = Tmux

[configuration_files]
.tmux.conf

[xdg_configuration_files]
tmux/tmux.conf
  1. toml and ini are very similar in syntax. We could use a toml array for the files. I've found that there is built-in support for schema validation as well. Plus, we could write a script that converts ini files to toml automatically so we don't have to manually update all the application files.
[application]
name = "Tmux"

[configuration_files]
files = [".tmux.conf"]

[xdg_configuration_files]
files = ["tmux/tmux.conf"]
  1. yaml is very common in my development world. There are also powerful packages like you mentioned but I hear you @pvinis that you do not like yaml as a language. But to explore it as an option, here's what it could look like.
name: Tmux
configuration_files:
  - .tmux.conf
xdg_configuration_files:
  - tmux/tmux.conf

What are your thoughts? Is there anything I haven't considered?

joshmedeski avatar Aug 02 '22 16:08 joshmedeski