Skip to content

Commit

Permalink
Move the prefix into a dedicated variable
Browse files Browse the repository at this point in the history
This is done to increase readability.
  • Loading branch information
webknjaz authored and chrysle committed Nov 26, 2023
1 parent 5076bc4 commit b497454
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions piptools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,9 @@ def _invert_negative_bool_options_in_config(
# Transform config key to its equivalent in the CLI
long_option = _convert_to_long_option(key)
new_key = cli_opts[long_option].name if long_option in cli_opts else key
if new_key.startswith("no_"):
new_key = new_key[3:]
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

# Invert negative boolean according to the CLI
Expand Down

0 comments on commit b497454

Please sign in to comment.