Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite completions to work with click>=8 #15

Merged
merged 3 commits into from
Nov 27, 2024
Merged

Conversation

teutat3s
Copy link
Member

Pull in jazzband/Watson#473. Thanks to @voidus for this work.

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.

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.
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,
def test_completion():
pytest.xfail(
"There's no good way to test this since click8, see "
"https://github.com/pallets/click/issues/1453"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also like to get tests working, let's try to fix them.

@teutat3s teutat3s merged commit f93c207 into main Nov 27, 2024
7 checks passed
@teutat3s teutat3s deleted the fix-zsh-completion branch November 27, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants