From e2444926e2fa177fb488ca3307d65a833e123bc8 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Fri, 28 Jun 2024 11:18:57 +0200 Subject: [PATCH] Run pre-commit --- Changelog.rst | 2 +- README.md | 2 +- click_repl/_completer.py | 1 - .../test_click_version_ge_8/test_option_completion_v8.py | 8 ++------ .../test_click_version_le_7/test_option_completion_v7.py | 4 +--- .../test_common_tests/test_hidden_cmd_and_args.py | 4 +--- tests/test_dev/test_get_internal_cmds.py | 4 +--- 7 files changed, 7 insertions(+), 18 deletions(-) diff --git a/Changelog.rst b/Changelog.rst index 02cd37e..315ba2d 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -32,4 +32,4 @@ - Backwards compatibility between click 7 & 8 - support for click 8 changes -- Update tests to expect hyphens \ No newline at end of file +- Update tests to expect hyphens diff --git a/README.md b/README.md index d846e77..5d81cdb 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ def myrepl(): 'history': FileHistory('/etc/myrepl/myrepl-history'), } repl(click.get_current_context(), prompt_kwargs=prompt_kwargs) - + cli() ``` And then your custom `myrepl` command will be available on your CLI, which diff --git a/click_repl/_completer.py b/click_repl/_completer.py index 1f64fa0..a7e8e0e 100644 --- a/click_repl/_completer.py +++ b/click_repl/_completer.py @@ -155,7 +155,6 @@ def _get_completion_for_Boolean_type(self, param, incomplete): ] def _get_completion_from_params(self, autocomplete_ctx, args, param, incomplete): - choices = [] param_type = param.type diff --git a/tests/test_completion/test_click_version_ge_8/test_option_completion_v8.py b/tests/test_completion/test_click_version_ge_8/test_option_completion_v8.py index 41169b8..cbef642 100644 --- a/tests/test_completion/test_click_version_ge_8/test_option_completion_v8.py +++ b/tests/test_completion/test_click_version_ge_8/test_option_completion_v8.py @@ -56,12 +56,8 @@ def shell_complete_func(ctx, param, incomplete): def autocompletion_cmd2(handler): pass - completions = list( - c.get_completions(Document("autocompletion-cmd2 --handler ")) - ) + completions = list(c.get_completions(Document("autocompletion-cmd2 --handler "))) assert {x.text for x in completions} == {"foo", "bar"} - completions = list( - c.get_completions(Document("autocompletion-cmd2 --handler ")) - ) + completions = list(c.get_completions(Document("autocompletion-cmd2 --handler "))) assert {x.text for x in completions} == {"foo", "bar"} diff --git a/tests/test_completion/test_click_version_le_7/test_option_completion_v7.py b/tests/test_completion/test_click_version_le_7/test_option_completion_v7.py index 13ff670..e825463 100644 --- a/tests/test_completion/test_click_version_le_7/test_option_completion_v7.py +++ b/tests/test_completion/test_click_version_le_7/test_option_completion_v7.py @@ -25,7 +25,5 @@ def shell_complete_func(ctx, args, incomplete): def autocompletion_opt_cmd2(handler): pass - completions = list( - c.get_completions(Document("autocompletion-opt-cmd2 --handler ")) - ) + completions = list(c.get_completions(Document("autocompletion-opt-cmd2 --handler "))) assert {x.text for x in completions} == {"foo", "bar"} diff --git a/tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py b/tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py index b0ed79c..3bad6bb 100644 --- a/tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py +++ b/tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py @@ -44,9 +44,7 @@ def args_choices_hidden_cmd(handler): completions = list(c.get_completions(Document("args-choices-hidden-cmd foo "))) assert {x.text for x in completions} == set() - completions = list( - c.get_completions(Document("args-choices-hidden-cmd --handler ")) - ) + completions = list(c.get_completions(Document("args-choices-hidden-cmd --handler "))) assert {x.text for x in completions} == set() diff --git a/tests/test_dev/test_get_internal_cmds.py b/tests/test_dev/test_get_internal_cmds.py index 6f07e8e..4d05b41 100644 --- a/tests/test_dev/test_get_internal_cmds.py +++ b/tests/test_dev/test_get_internal_cmds.py @@ -30,6 +30,4 @@ def test_get_registered_target_exit_cmd(test_input, expected): @pytest.mark.parametrize("test_input", ["hi", "hello", "76q358767"]) def test_get_registered_target(test_input): - assert ( - click_repl.utils._get_registered_target(test_input, "Not Found") == "Not Found" - ) + assert click_repl.utils._get_registered_target(test_input, "Not Found") == "Not Found"