Rewrite completions to work with click>=8#15
Merged
Conversation
They changed the api and the were still calling the functions using the old api style. Sadly, the new api doesnt make it easy to test. I have tried for a while but couldnt get anywhere, so now I tested it manually.
9040eeb to
2bc47b2
Compare
lines
tests/test_autocompletion.py:7:1: E303 too many blank lines (3)
def test_completion():
^
tests/test_autocompletion.py:9:80: E501 line too long (105 > 79 characters)
"There's no good way to test this since click8, see pallets/click#1453"
^
watson/autocompletion.py:37:80: E501 line too long (87 > 79 characters)
if project.startswith(incomplete) and project not in ctx.params.get("args", [])
^
watson/autocompletion.py:50:80: E501 line too long (83 > 79 characters)
return [frame.id for frame in watson.frames if frame.id.startswith(incomplete)]
^
watson/autocompletion.py:54:1: E266 too many leading '#' for block comment
^
watson/autocompletion.py:73:80: E501 line too long (83 > 79 characters)
if project.startswith(incomplete) and project not in ctx.params["projects"]
^
watson/autocompletion.py:78:1: E266 too many leading '#' for block comment
^
watson/cli.py:518:80: E501 line too long (80 > 79 characters)
@click.option('-p', '--project', 'projects', shell_complete=get_option_projects,
^
watson/cli.py:522:80: E501 line too long (83 > 79 characters)
@click.option('-T', '--tag', 'tags', shell_complete=get_option_tags, multiple=True,
^
watson/cli.py:788:80: E501 line too long (80 > 79 characters)
@click.option('-p', '--project', 'projects', shell_complete=get_option_projects,
^
watson/cli.py:792:80: E501 line too long (83 > 79 characters)
@click.option('-T', '--tag', 'tags', shell_complete=get_option_tags, multiple=True,
^
watson/cli.py:971:80: E501 line too long (80 > 79 characters)
@click.option('-p', '--project', 'projects', shell_complete=get_option_projects,
^
watson/cli.py:975:80: E501 line too long (83 > 79 characters)
@click.option('-T', '--tag', 'tags', shell_complete=get_option_tags, multiple=True,
b12f
approved these changes
Nov 25, 2024
| def test_completion(): | ||
| pytest.xfail( | ||
| "There's no good way to test this since click8, see " | ||
| "https://github.com/pallets/click/issues/1453" |
Member
There was a problem hiding this comment.
This seems to be a half-truth, there appears to be a way to get these tests running. In any case, it's more important to me that autocompletions work than that they're tested.
Member
Author
There was a problem hiding this comment.
I'd also like to get tests working, let's try to fix them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull in jazzband/Watson#473. Thanks to @voidus for this work.