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

Use Configy to read user settings (settings.json) too #2343

Merged
merged 1 commit into from
Jul 29, 2022

Conversation

Geod24
Copy link
Member

@Geod24 Geod24 commented Jul 28, 2022

Depends on #2310
First step towards #1832

Only the last two commits belong to this PR.

Once #2310 and this are merged, adding settings will be massively simpler.
I am thinking of holding back on #1832 so that we can come up with a "clean" format for the YAML settings, and it will make writing conversion code (from settings.json to settings.yaml) much simpler.

@Geod24 Geod24 marked this pull request as draft July 28, 2022 11:51
@Geod24 Geod24 changed the title Configy user setting Use Configy to read user settings (settings.json) too Jul 28, 2022
source/dub/dub.d Outdated Show resolved Hide resolved
@Geod24 Geod24 force-pushed the configy-user-setting branch 2 times, most recently from 093d064 to 21ae75f Compare July 28, 2022 16:43
@Geod24 Geod24 marked this pull request as ready for review July 28, 2022 16:44
@Geod24
Copy link
Member Author

Geod24 commented Jul 28, 2022

Rebased, should be G2G, let's see what the CI says.

@Geod24
Copy link
Member Author

Geod24 commented Jul 28, 2022

Hold on, there's one thing I forgot to tackle: Error handling.
This will error out on incorrectly formatted settings. I think that's a good thing, but we should add it to the changelog.
Additionally, the error message will not be properly (with colors) printed ATM, I'll fix this.

source/dub/dub.d Show resolved Hide resolved
source/dub/dub.d Outdated Show resolved Hide resolved
source/dub/dub.d Outdated Show resolved Hide resolved
@Geod24 Geod24 force-pushed the configy-user-setting branch 3 times, most recently from b8ff4e1 to 13c1d73 Compare July 29, 2022 06:06
source/dub/dub.d Outdated Show resolved Hide resolved
This will provide superior error messages to the user,
and match what we already do for `dub.selections.json`.

It also allows us to remove many fields from the `Dub` class.
Those fields existed so that we would not have to re-compute the data
from the JSON DubConfig was storing. Now that we use a simple struct,
and do the aggregation eagerly, all of that complexity can go.
Copy link
Member

@WebFreak001 WebFreak001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but feel free to first add the error handling you wanted to add

@WebFreak001 WebFreak001 self-requested a review July 29, 2022 06:56
@Geod24 Geod24 removed the blocked label Jul 29, 2022
@Geod24
Copy link
Member Author

Geod24 commented Jul 29, 2022

LGTM, but feel free to first add the error handling you wanted to add

I actually tested it yesterday and the error handling LGTM. It's not colored but all the information is here.
Since coloring the error handling will need to depend on whether we have a TTY or not, and we now have the colored output, I think I'll integrate things in a single PR separately.

@Geod24 Geod24 merged commit e58f8fc into dlang:master Jul 29, 2022
@Geod24 Geod24 deleted the configy-user-setting branch July 29, 2022 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants