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

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

Merged
merged 2 commits into from
Jul 30, 2024
Merged
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
hooks:
- id: add-trailing-comma
- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py38-plus]
Expand Down
4 changes: 2 additions & 2 deletions babi/buf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
def _diff_codes(
a: list[str],
b: list[str],
) -> Generator[tuple[str, int, int, int, int], None, None]:
) -> Generator[tuple[str, int, int, int, int]]:
matcher = difflib.SequenceMatcher(a=a, b=b)
for op, i1, i2, j1, j2 in reversed(matcher.get_opcodes()):
if op == 'replace':
Expand Down Expand Up @@ -201,7 +201,7 @@ def clear_callbacks(self) -> None:
self._del_callbacks.clear()

@contextlib.contextmanager
def record(self) -> Generator[list[Modification], None, None]:
def record(self) -> Generator[list[Modification]]:
modifications: list[Modification] = []

def set_cb(buf: Buf, idx: int, victim: str) -> None:
Expand Down
4 changes: 2 additions & 2 deletions babi/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ def edit_action_context(
self, name: str,
*,
final: bool,
) -> Generator[None, None, None]:
) -> Generator[None]:
continue_last = self._continue_last_action(name)
if not continue_last and self.undo_stack:
self.undo_stack[-1].final = True
Expand Down Expand Up @@ -980,7 +980,7 @@ def edit_action_context(
self.undo_stack.append(action)

@contextlib.contextmanager
def select(self) -> Generator[None, None, None]:
def select(self) -> Generator[None]:
if self.selection.start is None:
start = (self.buf.y, self.buf.x)
else:
Expand Down
2 changes: 1 addition & 1 deletion babi/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self) -> None:
self.prev: dict[str, str] = {}

@contextlib.contextmanager
def save(self) -> Generator[None, None, None]:
def save(self) -> Generator[None]:
history_dir = xdg_data('history')
os.makedirs(history_dir, exist_ok=True)
for filename in os.listdir(history_dir):
Expand Down
2 changes: 1 addition & 1 deletion babi/hl/replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def register_callbacks(self, buf: Buf) -> None:
"""our highlight regions are populated in other ways"""

@contextlib.contextmanager
def region(self, y: int, x: int, end: int) -> Generator[None, None, None]:
def region(self, y: int, x: int, end: int) -> Generator[None]:
# XXX: this assumes pair 1 is the background
attr = curses.A_REVERSE | curses.A_DIM | curses.color_pair(1)
self.regions[y] = (HL(x=x, end=end, attr=attr),)
Expand Down
2 changes: 1 addition & 1 deletion babi/perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def save_profiles(self, filename: str) -> None:


@contextlib.contextmanager
def perf_log(filename: str | None) -> Generator[Perf, None, None]:
def perf_log(filename: str | None) -> Generator[Perf]:
perf = Perf()
if filename is None:
yield perf
Expand Down
4 changes: 2 additions & 2 deletions babi/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ def retheme(self) -> None:
}

@contextlib.contextmanager
def retheme_handler(self) -> Generator[None, None, None]:
def retheme_handler(self) -> Generator[None]:
if sys.platform == 'win32': # pragma: win32 cover
yield # no signal handling on windows!
else:
Expand Down Expand Up @@ -879,7 +879,7 @@ def _init_screen() -> curses._CursesWindow:


@contextlib.contextmanager
def make_stdscr() -> Generator[curses._CursesWindow, None, None]:
def make_stdscr() -> Generator[curses._CursesWindow]:
"""essentially `curses.wrapper` but split out to implement ^Z"""
try:
yield _init_screen()
Expand Down
Loading