From b14a99db6b6e049b1d840eb953598103ee69055d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 23:24:25 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- babi/buf.py | 4 ++-- babi/file.py | 4 ++-- babi/history.py | 2 +- babi/hl/replace.py | 2 +- babi/perf.py | 2 +- babi/screen.py | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/babi/buf.py b/babi/buf.py index 347bc396..e8e94f47 100644 --- a/babi/buf.py +++ b/babi/buf.py @@ -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': @@ -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: diff --git a/babi/file.py b/babi/file.py index 7a0d3531..852c1974 100644 --- a/babi/file.py +++ b/babi/file.py @@ -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 @@ -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: diff --git a/babi/history.py b/babi/history.py index a4fceb56..806d7f02 100644 --- a/babi/history.py +++ b/babi/history.py @@ -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): diff --git a/babi/hl/replace.py b/babi/hl/replace.py index a52e7f83..5f2c3615 100644 --- a/babi/hl/replace.py +++ b/babi/hl/replace.py @@ -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),) diff --git a/babi/perf.py b/babi/perf.py index e2d8056c..9bb2d765 100644 --- a/babi/perf.py +++ b/babi/perf.py @@ -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 diff --git a/babi/screen.py b/babi/screen.py index e26c7026..60b7a38c 100644 --- a/babi/screen.py +++ b/babi/screen.py @@ -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: @@ -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()