From 60ea79c9c6db6bed69bf699aa8530741fc9bd1d2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 19:40:04 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.14 → v0.2.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.14...v0.2.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3bdb74e6..520d663a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: fix-byte-order-marker - id: detect-private-key - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.14 + rev: v0.2.0 hooks: - id: ruff args: [--fix-only, --exit-non-zero-on-fix] From 5726f0db22150633a47cdc70761cdee4aa0eb72b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 19:40:12 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- build_libtcod.py | 2 +- examples/samples_tcod.py | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/build_libtcod.py b/build_libtcod.py index 00b6036f..56161182 100755 --- a/build_libtcod.py +++ b/build_libtcod.py @@ -15,7 +15,7 @@ sys.path.append(str(Path(__file__).parent)) # Allow importing local modules. -import build_sdl # noqa: E402 +import build_sdl Py_LIMITED_API = 0x03060000 diff --git a/examples/samples_tcod.py b/examples/samples_tcod.py index f68fed86..7baf6af2 100755 --- a/examples/samples_tcod.py +++ b/examples/samples_tcod.py @@ -768,12 +768,11 @@ def on_draw(self) -> None: libtcodpy.console_put_char(sample_console, self.px, self.py, " ", libtcodpy.BKGND_NONE) self.px, self.py = libtcodpy.path_walk(self.path, True) # type: ignore libtcodpy.console_put_char(sample_console, self.px, self.py, "@", libtcodpy.BKGND_NONE) - else: - if not libtcodpy.dijkstra_is_empty(self.dijkstra): - libtcodpy.console_put_char(sample_console, self.px, self.py, " ", libtcodpy.BKGND_NONE) - self.px, self.py = libtcodpy.dijkstra_path_walk(self.dijkstra) # type: ignore - libtcodpy.console_put_char(sample_console, self.px, self.py, "@", libtcodpy.BKGND_NONE) - self.recalculate = True + elif not libtcodpy.dijkstra_is_empty(self.dijkstra): + libtcodpy.console_put_char(sample_console, self.px, self.py, " ", libtcodpy.BKGND_NONE) + self.px, self.py = libtcodpy.dijkstra_path_walk(self.dijkstra) # type: ignore + libtcodpy.console_put_char(sample_console, self.px, self.py, "@", libtcodpy.BKGND_NONE) + self.recalculate = True def ev_keydown(self, event: tcod.event.KeyDown) -> None: if event.sym == tcod.event.KeySym.i and self.dy > 0: