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

[pre-commit.ci] pre-commit autoupdate #10

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
args: [
Expand All @@ -10,20 +10,20 @@ repos:
]

- repo: https://github.com/psf/black
rev: 22.8.0
rev: 24.4.0
hooks:
- id: black
language_version: python3.8

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.981" # Use the sha / tag you want to point at
rev: "v1.9.0" # Use the sha / tag you want to point at
hooks:
- id: mypy
args: [ "--allow-untyped-globals", "--ignore-missing-imports" ]
additional_dependencies: [ types-all ]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-yaml
Expand All @@ -33,7 +33,7 @@ repos:
- id: check-added-large-files

- repo: https://github.com/pycqa/flake8
rev: "5.0.4" # pick a git hash / tag to point to
rev: "7.0.0" # pick a git hash / tag to point to
hooks:
- id: flake8
args: [ "--ignore=E501,W503,W504,E203,E251,E266,E401,E126,E124,C901" ]
Expand All @@ -42,13 +42,13 @@ repos:
]

- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
rev: v3.15.2
hooks:
- id: pyupgrade
args:
- "--py37-plus"
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v2.1.1
rev: v3.2.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
Expand Down
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
Loading