Respect skipRegistry value from configuration files#2903
Merged
dlang-bot merged 1 commit intodlang:masterfrom Apr 28, 2024
Merged
Respect skipRegistry value from configuration files#2903dlang-bot merged 1 commit intodlang:masterfrom
dlang-bot merged 1 commit intodlang:masterfrom
Conversation
Currently, the skipRegistry value in configuration files is ignored, the final value is either the one the user passed on the command line, which is the intended behavior, or the value `none` if the user didn't pass a --skip-registry argument. This commit fixes this by introducing the new value `default_` to the SkippackageSuppliers enum to know when the user didn't pass the skip-registry argument and the value should be taken from the configuration files. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
|
✅ PR OK, no changes in deprecations or warnings Total deprecations: 0 Total warnings: 0 Build statistics: statistics (-before, +after)
executable size=5364248 bin/dub
rough build time=64sFull build output |
thewilsonator
approved these changes
Apr 27, 2024
Geod24
reviewed
Apr 28, 2024
| standard, /// Does not use the default package suppliers (`defaultPackageSuppliers`). | ||
| configured, /// Does not use default suppliers or suppliers configured in DUB's configuration file | ||
| all, /// Uses only manually specified package suppliers. | ||
| default_, /// The value wasn't specified. It is provided in order to know when it is safe to ignore it |
Member
There was a problem hiding this comment.
Instead of modifying the enum, passing a Nullable would be a better option, wouldn't it ?
Contributor
Author
There was a problem hiding this comment.
When I wrote this I considered both passing a Nullable in the constructor or modifying the enum as possible solutions. My final conclusion was that I would rather not change the constructor semantics and, instead, modify the enum.
I wouldn't mind doing as you say and changing the approach to use a Nullable.
the-horo
added a commit
to the-horo/dub
that referenced
this pull request
May 22, 2025
Instead of having a different enum value for stating that the value is not specified and it should be taken from the configuration files, use a Nullable. This has been suggested in dlang#2903 (comment) The main reason for this change is going through the other places where the configuration files were not honored (e.g. dub lint) (which was the intent of the original PR). It would be a shorter change to modify the current code to use the .default_ enum value when it was appropriate but if I have to change the code I might as well go and implement the less error-prone solution with Nullable. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
the-horo
added a commit
to the-horo/dub
that referenced
this pull request
May 22, 2025
Instead of having a different enum value for stating that the value is not specified and it should be taken from the configuration files, use a Nullable. This has been suggested in dlang#2903 (comment) The main reason for this change is going through the other places where the configuration files were not honored (e.g. dub lint) (which was the intent of the original PR). It would be a shorter change to modify the current code to use the .default_ enum value when it was appropriate but if I have to change the code I might as well go and implement the less error-prone solution with Nullable. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
the-horo
added a commit
to the-horo/dub
that referenced
this pull request
May 22, 2025
Instead of having a different enum value for stating that the value is not specified and it should be taken from the configuration files, use a Nullable. This has been suggested in dlang#2903 (comment) The main reason for this change is going through the other places where the configuration files were not honored (e.g. dub lint) (which was the intent of the original PR). It would be a shorter change to modify the current code to use the .default_ enum value when it was appropriate but if I have to change the code I might as well go and implement the less error-prone solution with Nullable. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
the-horo
added a commit
to the-horo/dub
that referenced
this pull request
May 22, 2025
Instead of having a different enum value for stating that the value is not specified and it should be taken from the configuration files, use a Nullable. This has been suggested in dlang#2903 (comment) The main reason for this change is going through the other places where the configuration files were not honored (e.g. dub lint) (which was the intent of the original PR). It would be a shorter change to modify the current code to use the .default_ enum value when it was appropriate but if I have to change the code I might as well go and implement the less error-prone solution with Nullable. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
Geod24
pushed a commit
that referenced
this pull request
May 25, 2025
Instead of having a different enum value for stating that the value is not specified and it should be taken from the configuration files, use a Nullable. This has been suggested in #2903 (comment) The main reason for this change is going through the other places where the configuration files were not honored (e.g. dub lint) (which was the intent of the original PR). It would be a shorter change to modify the current code to use the .default_ enum value when it was appropriate but if I have to change the code I might as well go and implement the less error-prone solution with Nullable. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the skipRegistry value in configuration files is ignored, the final value is either the one the user passed on the command line, which is the intended behavior, or the value
noneif the user didn't pass a --skip-registry argument.This commit fixes this by introducing the new value
default_to the SkippackageSuppliers enum to know when the user didn't pass the skip-registry argument and the value should be taken from the configuration files.Be aware that the output of an invalid
skipRegistryvalue indub.settings.jsonhas changed:Before this PR:
After this PR: