Cleanup documentation for `8.4.0` (#3393)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Rowlando13 · committed by GitHub · parents ec82269, 84a42d3 · Browse files · 3 files·+16 added−10 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+16 added−10 removed
- other:+16 added−10 removed
Provenance
- Commit
ba745ac- Tree
699f71c- Author
Rowlando13 <67291205+Rowlando13@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent 1
ec82269- Parent 2
84a42d3
3 files changed+16 added−10 removed
modified:src/click/shell_completion.py+9 added-8 removed
419 unmodified lines420 421 return args, incomplete422 423 def format_completion(self, item: CompletionItem) -> str:424- """Format completion item for Fish shell.425-426- Escapes newlines in both value and help text to prevent427- Fish shell parsing errors.428-429- .. versionchanged:: 8.3430- Escape newlines in help text to fix completion errors431- with multi-line help strings.424 """425+ .. versionchanged:: 8.4426+ Escape newlines in value and help to fix completion errors with427+ multi-line help strings.428+ """429+ # The fish completion script splits each response line on literal430+ # newlines, so any newline in the value or help would corrupt the431+ # frame. Replace them with the two-character escape "\n" so the text432+ # round-trips through fish without breaking the format. The "_"433+ # sentinel for missing help mirrors :class:`ZshComplete`.434 help_ = item.help or "_"435 value = item.value.replace("\n", r"\n")436 help_escaped = help_.replace("\n", r"\n")437 return f"{item.type}\n{value}\n{help_escaped}"242 unmodified linesmodified:.gitignore+1 added-1 removed
4 unmodified lines5 .coverage*6 htmlcov/7 .tox/8 docs/_build/9-.venv9+.venv/modified:CHANGES.rst+6 added-1 removed
15 unmodified lines16 :class:`~typing.TypedDict` subclasses instead of17 ``dict[str, Any]``.18 - :class:`CompositeParamType` and the number-range base are now19 generic with abstract methods.20+- Refactor ``convert_type`` to extract type inference into a private21+ ``_guess_type`` helper, and add :func:`typing.overload` signatures.22+ :pr:`3372`23 - :class:`Parameter` typing improvements. :pr:`2805`24 25 - :class:`Parameter` is now an abstract base class, making explicit26 that it cannot be instantiated directly.21 unmodified lines48 - Use :func:`os.startfile` on Windows to open URLs in :func:`open_url`,49 replacing the ``start`` built-in which cannot be invoked without50 ``shell=True``. :issue:`3164` :pr:`3186`51 - Fix Fish shell completion errors when option help text contains newlines.49- :issue:`3043`52+ :issue:`3043` :pr:`3126`53 - Add :class:`NoSuchCommand` exception with suggestions for misspelled54 commands. :issue:`3107` :pr:`3228`55 - Use :class:`ValueError` message when conversion in :class:`FuncParamType` would56 fail. :issue:`3105` :pr:`3211`2 unmodified lines59 - Show custom error messages from types when :func:`prompt` with60 ``hide_input=True`` fails validation, instead of always showing a61 generic message. Built-in type messages mask the input value.62 :issue:`2809` :pr:`3256`63+- Mark additional built-in strings with ``gettext()`` to extend translation64+ coverage. :pr:`2902`65 - Fix feature switch groups (several ``flag_value`` options sharing one66 parameter name) silently dropping an explicit ``default`` when a sibling67 option without an explicit default was declared first. Arbitration is now68 source-aware: a more explicit :class:`ParameterSource` always wins, and1379 unmodified lines