7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-01 05:40:48 +00:00

Merge remote-tracking branch 'origin/master' into nightly

This commit is contained in:
Overhang.IO 2022-11-17 14:44:20 +00:00
commit 1890557d40
2 changed files with 14 additions and 0 deletions

View File

@ -18,6 +18,7 @@ Every user-facing change should have an entry in this changelog. Please respect
## Unreleased
- [Improvement] Auto-complete implicit `local/dev --mount /path/to/...` options. (by @regisb)
- 💥[Feature] Strong typing of action and filter hooks: this allows us to detect incorrect calls to `actions.add` or `filters.add` early. Strong typing forces us to break the `do` and `apply` API by removing the `context` named argument. Developers should replace `do(context=...)` by `do_from_context(..., )` (and similar for `apply`).
## v14.1.2 (2022-11-02)

View File

@ -4,6 +4,7 @@ import typing as t
from copy import deepcopy
import click
from click.shell_completion import CompletionItem
from typing_extensions import TypeAlias
from tutor import config as tutor_config
@ -172,6 +173,18 @@ class MountParam(click.ParamType):
raise self.fail(f"no mount found for {value}")
return mounts
def shell_complete(
self, ctx: click.Context, param: click.Parameter, incomplete: str
) -> t.List[CompletionItem]:
"""
Mount argument completion works only for the single path (implicit) form. The
reason is that colons break words in bash completion:
http://tiswww.case.edu/php/chet/bash/FAQ (E13)
Thus, we do not even attempt to auto-complete mount arguments that include
colons: such arguments will not even reach this method.
"""
return [CompletionItem(incomplete, type="file")]
mount_option = click.option(
"-m",