srsudar / eg

Useful examples at the command line.
MIT License
1.8k stars 98 forks source link

Make configs TOML-compatible #92

Open EmilyGraceSeville7cf opened 2 years ago

EmilyGraceSeville7cf commented 2 years ago

For instance instead of:

[eg-config]
examples-dir = ~/examples-dir
custom-dir = ~/my/fancy/custom/dir

write:

[eg-config]
examples-dir = "~/examples-dir"
custom-dir = "~/my/fancy/custom/dir"

Maybe it's just a documentation mistake and configs are already written in TOML.

srsudar commented 2 years ago

Hmm can you tell me a bit more about what taplo is? I'm not sure I understand what a JSON schema for taplo would mean.

I don't think that the documentation and configs are already written in TOML, though I might be mistaken. eg uses the ConfigParser package, which when I wrote it I believe I thought was the standard way of parsing various .ini and rc files.

EmilyGraceSeville7cf commented 2 years ago

JSON schema for taplo means that when I install taplo extension for VS Code I have suggestions for eg configs from JSON schema:

image

The problem with configs - they don't provide quoting for strings (which TOML requires). Please switch to another parser because the current one is for INI files. JSON Schema don't support INI files so it's better to use TOML. 😄

srsudar commented 2 years ago

Oh got it. Seems cool to have that kind of autocompletion, I agree. I'm a bit behind on PRs atm due to work stuff, but I'll take a look at this. I like this kind of integration.