Repository navigation
Fix rejection of negating CLI boolean flags in config - #1913
Conversation
37664bf to
401c5fd
Compare
for more information, see https://pre-commit.ci
…pip-tools into support-boolean-flags-in-config
|
Thanks for the review! I've tried to apply your suggestions. |
* Refactor-out parse_config_file() * Fix failing tests * Naming * Naming
And correct README filename in `tox` session.
|
Sure, I added a small paragraph. |
atugushev
left a comment
There was a problem hiding this comment.
Thanks for the docs! A few comments to consider below:
| Since `pip-tools` supports default values vor [all valid command-line flags](/cli/index.md) | ||
| of its subcommands, you can also achieve the functionality in the above example | ||
| by setting a configuration value for the negative flag `--no-annotate`: | ||
|
|
||
| ```toml | ||
| [tool.pip-tools] | ||
| no-annotate = false | ||
| ``` | ||
|
|
There was a problem hiding this comment.
This may seem like a special case. However, we essentially support any long options (those starting with -- prefix) listed in command line reference represented in either snake or kebab case (without the double dash). Perhaps it's worth mentioning this instead? What do you think?
There was a problem hiding this comment.
Apparently, the Sphinx TOML lexer doesn't seem to concur with that suggestion...
Perhaps it isn't such a good idea to support both cases, then?
There was a problem hiding this comment.
I've tested that configuration though, and seen it work...
There was a problem hiding this comment.
It might work, since we do the normalization before the validation for now. However, we should not encourage this, because it will be fixed soon.
There was a problem hiding this comment.
We may be able to call _validate_config() directly in _invert_negative_bool_options_in_config().
|
Thanks, I agree with your points and reworked the documentation. |
|
Sorry for the misunderstanding, I hope it's better now. |
@chrysle a side-note about changelog: "Add support" usually goes to "Features" section. Do you think it would make sense to either rephrase the PR title or reconsider its labels? |
|
Thanks for pointing out! How about:
|
Closes #1909
Contributor checklist
Maintainer checklist
backwards incompatible,feature,enhancement,deprecation,bug,dependency,docsorskip-changelogas they determine changelog listing.