Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and chrysle committed Nov 26, 2023
1 parent b497454 commit b080617
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions piptools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,12 @@ def _invert_negative_bool_options_in_config(
long_option = _convert_to_long_option(key)
new_key = cli_opts[long_option].name if long_option in cli_opts else key
negative_option_prefix = "no_"
if new_key.startswith(negative_option_prefix):
new_key = new_key[len(negative_option_prefix):]
assert new_key is not None
if (
new_key.startswith(negative_option_prefix)
and long_option not in ONLY_NEGATIVE_OPTIONS
):
new_key = new_key[len(negative_option_prefix) :]
assert new_key is not None

# Invert negative boolean according to the CLI
Expand Down

0 comments on commit b080617

Please sign in to comment.