Skip to content
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

Changing the format of settings.json #1832

Open
Geod24 opened this issue Dec 23, 2019 · 5 comments · May be fixed by #2546
Open

Changing the format of settings.json #1832

Geod24 opened this issue Dec 23, 2019 · 5 comments · May be fixed by #2546

Comments

@Geod24
Copy link
Member

Geod24 commented Dec 23, 2019

I believe settings.json was a great addition to dub, something I've personally been wanting for a while. Allowing users to e.g. choose their default compiler without having to compile dub itself.

I'd like to extend it, for example by giving it the ability to use a specific Copyright / authors string by default, and by providing a default value for --cache. There are also a few bugs that need fixing (#1472 is trivial, for example).

However, currently, it suffers from one great downside which should make anyone wary of extending it: it is written in JSON.

JSON has proven to be a bad format for human-written configuration. Be it the lack of comments, noisy syntax, lack of typing... So much that a push was done to move to SDLang a few years ago.
However JSON enjoys wide support among editors and tools, and is still familiar to people than SDLang, the later being yet another skill a newcomer to D has to pick up.

Hence, I would like to bring forth the idea of changing settings.json to use a different format.
Out of all the markup languages out there, I my vote would go to YAML:

I think the comparison is fairly simple.

Would love some opinion from DUB / settings.json users.

@jacob-carlborg
Copy link
Contributor

I would like to add. That most importantly, YAML is a superset of JSON. All existing JSON files would still be readable by Dub if the format is changed to YAML. No need for multiple parser inside Dub. Perhaps only the file extension (.json) need to be deprecated.

@wilzbach
Copy link
Member

My vote goes for YAML as well 👍

@andre2007
Copy link
Contributor

andre2007 commented Dec 23, 2019

Also my vote goes for YAML. It is well known in the industry.
Although there should be no need to edit the settings file manually but dub should be capable to set the settings file values by a dedicated command.

@PetarKirov
Copy link
Member

PetarKirov commented Dec 25, 2019

I agree with @Geod24 high-level goals of extending setting.json's uses. I'm ok with using YAML (in addition to SDLang) as it's also growing in popularity among various other projects.
However, unless we target this feature for 2.0, we need to keep backwards compatibility and continue supporting the current format of settings.json.

@Geod24
Copy link
Member Author

Geod24 commented Jul 28, 2022

After #2310 we'll be able to do this fairly easily and in a backward-compatible manner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants