-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
admin: add unset command #1556
admin: add unset command #1556
Conversation
Issue #1554 raises valid concern about how IMHO, I'd rather have |
I'm with you completely. I felt a little uneasy when I was doing it, but somehow I ignore my instincts and convinced myself it was okay 😅
Yes, I agree 😄 If a string None is present in the config, then it will be interpreted as a string, as expected. Thus, it makes no sense to try to set a Also, given how setting values are pulled from a config object, just means that a
There is no real meaning to having removed an option. It will just return the default. And because setting a value to |
Since this is a relatively large change... changing to |
I definitely think adding an Not that I have any modules that look at |
Yea... was trying to minimize duplication of the section and option parsing. Refactor coming soon, then. |
That's the way to go! 👍 |
38a2352
to
2ab336f
Compare
'tis here. |
.set
literal string None
argument as NoneType
I guess I'll come back to this in a few days, after 6.6.x is merged into master and you can rebase. 😁 |
Ready to rebase; I merged 6.6.x into master just now. |
2ab336f
to
f8779e1
Compare
🎉 |
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.
Control flow is key!
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.
Almost done. 👍
658f608
to
0f80b16
Compare
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.
I think this is at nitpick stage. 🎉
Nitpicks have been addressed! 🎉 Now there's just a squash (of the fixup commits) and a rebase (to resolve the conflicts introduced on |
Any setting with `default = NO_DEFAULT` cannot be unset; e.g., `core.owner`
Previously, there was no feedback from the bot on successful `set`/`unset`. This led to some confusion during testing. Now, the bot will `say` "OK... " upon successful setting/unsetting of an option. Additionally, viewing an option will also show the value `type` to avoid issues like differentiating between `= None (NoneType)` and `= None (str)`, where one may have intentionally set `None` as a `str`, or accidentally set `None` while trying to clear/unset an option.
bc8ff2d
to
01bcf40
Compare
Done. |
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.
🎉 Thanks for the rebase!
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.
Looks good to me.
I've a small question about how to display the InvalidSection
and InvalidSectionOption
, you can try and see if it can be better, or you can ignore it, it's fine by me.
If the value to be set is ever literally 'None' (string), then the setting is set to actual
NoneType
None
. When a trueNone
is set to a config attribute, the setting will essentially be reset to the default value. I feel this should be the expected behavior; i.e., a user should not be able to set a null value for something with a default, because presumably, that default is there for a reason.Testing: (see #1554 for steps)
Fixes #1554