From b080617075d81438636151f5646a03e26c3b0cb7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:48:00 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- piptools/utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/piptools/utils.py b/piptools/utils.py index b5b6e334..a87dacde 100644 --- a/piptools/utils.py +++ b/piptools/utils.py @@ -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