Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 25, 2024
1 parent d67a47a commit 1164d85
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/test_abbrevs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def _wrapper(text):
return _wrapper


ps_special_expand = (
lambda buffer, word: "procs" if buffer.text.startswith(word) else word
ps_special_expand = lambda buffer, word: (
"procs" if buffer.text.startswith(word) else word
)


Expand Down
1 change: 1 addition & 0 deletions tests/test_ptk_multiline.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests sample inputs to PTK multiline and checks parser response"""

from collections import namedtuple
from unittest.mock import MagicMock, patch

Expand Down
3 changes: 2 additions & 1 deletion tests/test_ptk_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def test_ptk_prompt(line, exp, ptk_shell, capsys):
)
def test_ptk_default_append_history(cmd, exp_append_history, ptk_shell, monkeypatch):
"""Test that running an empty line or a comment does not append to history.
This test is necessary because the prompt-toolkit shell uses a custom _push() method that is different from the base shell's push() method."""
This test is necessary because the prompt-toolkit shell uses a custom _push() method that is different from the base shell's push() method.
"""
inp, out, shell = ptk_shell
append_history_calls = []

Expand Down
3 changes: 1 addition & 2 deletions xontrib_ptk_shell/abbrevs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
if tp.TYPE_CHECKING:

class AbbrCallType(tp.Protocol):
def __call__(self, word: str, buffer: Buffer) -> str:
...
def __call__(self, word: str, buffer: Buffer) -> str: ...

AbbrValType = tp.Union[str, AbbrCallType]

Expand Down
1 change: 1 addition & 0 deletions xontrib_ptk_shell/completer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Completer implementation to use with prompt_toolkit."""

import os

from prompt_toolkit.application.current import get_app
Expand Down
4 changes: 1 addition & 3 deletions xontrib_ptk_shell/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ def to_completion_mode(x):
y = (
"default"
if y in ("", "d", "xonsh", "none", "def")
else "menu-complete"
if y in ("m", "menu", "menu-completion")
else y
else "menu-complete" if y in ("m", "menu", "menu-completion") else y
)
if y not in CANONIC_COMPLETION_MODES:
warnings.warn(
Expand Down
1 change: 1 addition & 0 deletions xontrib_ptk_shell/free_cwd.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
if any extensions are enabled that hook the prompt and relies on
``os.getcwd()``.
"""

import functools
import os
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions xontrib_ptk_shell/shell.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The prompt_toolkit based xonsh shell."""

import os
import re
import sys
Expand Down

0 comments on commit 1164d85

Please sign in to comment.