-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fixes #3084 — Restore optional value behavior for options with flag_value #3104
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
base: stable
Are you sure you want to change the base?
Conversation
tests/test_optional_value_bug.py
Outdated
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.
Don't create a completely new file to test one bug fix. All that's needed is probably one new parametrization of an existing test.
Also, the docstrings, comments, and verbosity of the tests is not really helping at all.
src/click/core.py
Outdated
| :param hidden: hide this option from help outputs. | ||
| :param attrs: Other command arguments described in :class:`Parameter`. | ||
| .. versionchanged:: 8.3.0 |
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.
This version is wrong.
src/click/core.py
Outdated
| :param attrs: Other command arguments described in :class:`Parameter`. | ||
| .. versionchanged:: 8.3.0 | ||
| Fixed a regression where options with ``flag_value`` and ``is_flag=False`` |
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.
This change comment is way too verbose. "Restore optional value behavior when flag_value is set."
CHANGES.rst
Outdated
| Unreleased | ||
|
|
||
| - Don't discard pager arguments by correctly using subprocess.Popen. :issue:`3039` :pr:`3055` | ||
| - Fix: Restore documented behavior for options with flag_value and is_flag=False (#3084). |
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.
Follow the style in the rest of the changelog. Don't add a tag prefix, use the correct reference, add this to a new section rather than an already released version.
Also, the PR title, commit message, docstring, and this line are all different wordings of the same fix. Be consistent.
|
I appreciate that you submitted a fix for this. However, your use of AI really detracted from the quality of the PR. Please avoid using AI, or at least carefully review the results and compare them to the project style before submitting. The initial PR description is also a wordy mess that AI tends to produce. "fixes #..." should be in the PR description, not a tag in the title. You haven't configured git correctly, so your commits aren't linked to your GitHub account. The commit message, PR title, changelog entry, and docstring changelog entry are all worded differently. |
|
I will try to be more careful next time, Thank you so much for the review |
|
This needs to be rebased onto stable instead of main as well. |
b9ca3af to
2f36965
Compare
|
Hi, I think I have made all the relevant changes, I am sorry for being negligence before. It was my first contribution to open source I went on chasing for a quick win. please lemme know if there is anything still wrong I will try to make it right. Thank you!! |
bb37a63 to
6fbc2ae
Compare
…ntained consistency throughout the docs.
6fbc2ae to
341d453
Compare
This PR:
flag_valueandis_flag=Falsework as documented, accepting just the flag and using theflag_valueas the option's value.tests/test_optional_value_bug.pythat fail before and pass after this fix, demonstrating the bug and its resolution.This restores the intended and documented API behavior, aligning Click’s implementation with user expectations and preventing regressions in downstream projects