Repository navigation
Conversation
|
Both of these seem like bugs. I feel like the automatic names should always be normalized and pass |
254d9e4 to
49a5f5a
Compare
OK cool, that was also my feeling. We don't want special treatments of the |
49a5f5a to
ad8601c
Compare
Argument name to be a Python identifier
@davidism Done. I did not pushed the normalization too much. So there is one bothering difference between |
Argument name to be a Python identifierArgument name to be a Python identifier
05c4439 to
3d4142f
Compare
Argument name to be a Python identifierArgument and Option automatic naming
|
I just pushed the alignment and normalization of naming a bit more and updated the differences in the body of that PR. |
3d4142f to
b4606f9
Compare
Argument and Option automatic namingb4606f9 to
ff79a3c
Compare
|
OK these were my final edits. You can review this PR. |
ff79a3c to
6f9943e
Compare
|
Ahah agreed 100% about the verbosity of the docs. They accumulates all my changes and discovery through the process of producing this PR. It was a way for me to highlight how clunky the ID derivation is at the moment. My thinking being that if I can write the docs easily and make them flow naturally, it probably means the underlying concept and implementation is clean. Ok for a 9.0.0 target then. What I will do:
|
6f9943e to
127ed65
Compare
Problem is the list of Python keywords would prevent some options like |
|
OK so I think I am done with this PR and it now implements the ideal target behavior for 9.0.0. I will now create in the next few days a sibling PR for 8.5.1/8.6.0 that detects the changes and emits deprecation warnings. If I discover new stuff while producing this other PR I might bring some changes here. |
Click 9.0 refuses such a name; warn a release ahead so the break can diffuse. Prepares the ground for #3827, as promised in pull/3827#issuecomment-5583963038.
Click 9.0 refuses such a name; warn a release ahead so the break can diffuse. Prepares the ground for pallets#3827, as promised in pull/3827#issuecomment-5583963038.
Prepares the ground for pallets#3827 and future 9.0.0 release
Prepares the ground for pallets#3827 and future 9.0.0 release
127ed65 to
0054c44
Compare
Prepares the ground for pallets#3827
Prepares the ground for pallets#3827
0054c44 to
3dcde39
Compare
3dcde39 to
d8a0c46
Compare
Make `DeprecationWarning` from pallets#3866 into `TypeError`
d8a0c46 to
1652ae5
Compare
Warning
This PR is waiting for the 9.x release cycle to start. To prevent merging into
mainbefore that, it is kept as a draft. Also needs to be revised against #3924.Tl;Dr: this PR make the
DeprecationWarningintroduced in 8.6.0 intoTypeError(see #3866).Description
This PR changes the behavior of automatic naming:
0-file,foo.barandfoo barare now refused.expose_value=Falseno longer bypasses that check, on both arguments and options.click.argument(expose_value=False)andclick.option(expose_value=False)used to produce a""parameter.click.option("--in-file", "Input_File")names its parameterinput_file.What does not change:
-becomes_and the result is lower cased.click.option("--0-file").How to migrate:
click.option("--0-file", "zero_file").metavarto keep the old display:click.argument("zero_file", metavar="0-FILE").This PR shares the majority of the tests from #3866 which lockdown all other edge-cases and canonical naming behavior.
Context
It is in the same vein as my previous PR at #3808 , and is also based on a collection of edge-cases I accumulated over the years. It also covers platform differences between Windows and Unix-like (see: #2483).
Note: this PR started as simple test coverage expansion but ended up implementing sanitizing fixes. Hence its original
param-name-case-coveragename