-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
Respect skipRegistry value from configuration files #2903
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=64s Full build output
|
@@ -17,6 +17,7 @@ public enum SkipPackageSuppliers { | |||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of modifying the enum, passing a Nullable
would be a better option, wouldn't it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.Be aware that the output of an invalid
skipRegistry
value indub.settings.json
has changed:Before this PR:
After this PR: