Skip to content

Commit b033bf2

Browse files
committed
pre-commit update
1 parent a8f66fc commit b033bf2

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
- id: fix-byte-order-marker
1818
- id: detect-private-key
1919
- repo: https://github.com/astral-sh/ruff-pre-commit
20-
rev: v0.5.6
20+
rev: v0.6.0
2121
hooks:
2222
- id: ruff
2323
args: [--fix-only, --exit-non-zero-on-fix]

examples/samples_tcod.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,7 @@ def on_draw(self) -> None:
726726
for y in range(SAMPLE_SCREEN_HEIGHT):
727727
for x in range(SAMPLE_SCREEN_WIDTH):
728728
d = libtcodpy.dijkstra_get_distance(self.dijkstra, x, y)
729-
if d > self.dijkstra_dist:
730-
self.dijkstra_dist = d
729+
self.dijkstra_dist = max(d, self.dijkstra_dist)
731730
# compute path from px,py to dx,dy
732731
libtcodpy.dijkstra_path_set(self.dijkstra, self.dx, self.dy)
733732
self.recalculate = False

tests/conftest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def pytest_addoption(parser: pytest.Parser) -> None:
1515
parser.addoption("--no-window", action="store_true", help="Skip tests which need a rendering context.")
1616

1717

18-
@pytest.fixture()
18+
@pytest.fixture
1919
def uses_window(request: pytest.FixtureRequest) -> Iterator[None]:
2020
"""Marks tests which require a rendering context."""
2121
if request.config.getoption("--no-window"):
@@ -40,7 +40,7 @@ def session_console(request: pytest.FixtureRequest) -> Iterator[tcod.console.Con
4040
yield con
4141

4242

43-
@pytest.fixture()
43+
@pytest.fixture
4444
def console(session_console: tcod.console.Console) -> tcod.console.Console:
4545
console = session_console
4646
tcod.console_flush()
@@ -54,18 +54,18 @@ def console(session_console: tcod.console.Console) -> tcod.console.Console:
5454
return console
5555

5656

57-
@pytest.fixture()
57+
@pytest.fixture
5858
def offscreen(console: tcod.console.Console) -> tcod.console.Console:
5959
"""Return an off-screen console with the same size as the root console."""
6060
return tcod.console.Console(console.width, console.height)
6161

6262

63-
@pytest.fixture()
63+
@pytest.fixture
6464
def fg() -> tcod.Color:
6565
return tcod.Color(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
6666

6767

68-
@pytest.fixture()
68+
@pytest.fixture
6969
def bg() -> tcod.Color:
7070
return tcod.Color(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
7171

tests/test_libtcodpy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,15 +660,15 @@ def test_heightmap() -> None:
660660
POINTS_AC = POINT_A + POINT_C # invalid path
661661

662662

663-
@pytest.fixture()
663+
@pytest.fixture
664664
def map_() -> Iterator[tcod.map.Map]:
665665
map_ = tcod.map.Map(MAP_WIDTH, MAP_HEIGHT)
666666
map_.walkable[...] = map_.transparent[...] = MAP[...] == " "
667667
yield map_
668668
libtcodpy.map_delete(map_)
669669

670670

671-
@pytest.fixture()
671+
@pytest.fixture
672672
def path_callback(map_: tcod.map.Map) -> Callable[[int, int, int, int, None], bool]:
673673
def callback(ox: int, oy: int, dx: int, dy: int, user_data: None) -> bool:
674674
return bool(map_.walkable[dy, dx])

0 commit comments

Comments
 (0)