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 Sep 20, 2023
1 parent f185118 commit ad82041
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion piptools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,11 @@ def _invert_negative_bool_options_in_config(
for key, value in config.items():
# 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.replace("no_", "")
new_key = (
cli_opts[long_option].name
if long_option in cli_opts
else key.replace("no_", "")
)
assert new_key is not None

# Invert negative boolean according to the CLI
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ markers = ["network: mark tests that require internet access"]
include = ["piptools*"]

[tool.setuptools_scm]
local_scheme = "dirty-tag"
local_scheme = "dirty-tag"
2 changes: 1 addition & 1 deletion tests/test_cli_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3115,7 +3115,7 @@ def test_invalid_cli_boolean_flag_config_option_captured(
out = runner.invoke(cli, [req_in.as_posix(), "--config", config_file.as_posix()])

assert out.exit_code == 2
assert "No such config key 'no_annnotate'." in out.stderr
assert "No such config key 'annnotate'." in out.stderr


strip_extras_warning = (
Expand Down

0 comments on commit ad82041

Please sign in to comment.