-
-
Notifications
You must be signed in to change notification settings - Fork 8
added boolean optional argument support #166
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
added boolean optional argument support #166
Conversation
This comment has been minimized.
This comment has been minimized.
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, thank you for adding this !
Codecov Report
@@ Coverage Diff @@
## main #166 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 21 21
Lines 591 604 +13
=========================================
+ Hits 591 604 +13
|
|
@Pierre-Sassoulas I think I should also add this to the documentation on the toml configuration, do you happen to know where that should be added? |
|
This is the full doc on configuration: https://pydocstringformatter.readthedocs.io/en/latest/?badge=latest#configuration |
|
Oh i see... so that is getting auto generated from the readme ... Should we modify: To this: to exemplify how to set other argument types. |
|
Maybe we could autogenerate the full list of possible options with default values ? |
|
I like that idea but it would not exemplify the use of 'no-xxxxx = true' style configs. ... Maybe also have comments showing the equivalent config on the negative form ?? This could be a feature for a later improvement in documentation (and probably not inside the readme ... So it does not get too clutered) |
|
I think the no-x style is only used in CLI (or should) this is given by the |
|
The no- options are needed to disable default checks. I think they should indeed be shown as a comment in the example config. For pylint we use |
Isn't it possible to do |
It depends on how we handle that in this PR. We could just disallow them completely as well? What do you think makes most sense @jspaezp? |
|
Hello there! I thought about it for a while... regarding: #166 (comment)
its easy but not SUUUUPER EASY, just having to consider it robust to arguments that in the future might start with --no- but are not of the same "optional boolean" type. I will add the mods to the readme in the meantime |
This comment has been minimized.
This comment has been minimized.
|
I meant it's possible to do it as a user (so you should always be able to use simply 'x' which is simpler both for the user and for us). Imo we should not permit to use no-x in configuration, there's very little benefit and a lot of headaches to expect. |
This comment has been minimized.
This comment has been minimized.
|
Alright, I added the enforcement of the positive form of the arguments (+testing, +updated readme, +informative error message). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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 like the clear error message ! LGTM, I'll let Daniel merge.
Co-authored-by: Daniël van Noord <[email protected]>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Daniël van Noord <[email protected]>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Thanks once again @jspaezp 🎉 😄 |
|
According to the primer, this change has no effect on the checked open source code. 🤖🎉 |
Improved the toml parsing so it supports
BooleanOptionalActionarguments in it.(also added tests for it ...)
.... where should I document this?