Skip to content

Commit 3f25370

Browse files
committed
* Update uv lockfile
* Update uv and ruff * Reformat code
1 parent cf456c0 commit 3f25370

4 files changed

Lines changed: 76 additions & 81 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repos:
66
- id: pre-commit-update
77

88
- repo: https://github.com/astral-sh/uv-pre-commit
9-
rev: 0.9.17
9+
rev: 0.9.18
1010
hooks:
1111
# Update the uv lockfile
1212
- id: uv-lock
@@ -66,7 +66,7 @@ repos:
6666
- id: yamllint
6767

6868
- repo: https://github.com/astral-sh/ruff-pre-commit
69-
rev: v0.14.9
69+
rev: v0.14.10
7070
hooks:
7171
# Run the linter
7272
- id: ruff-check

src/2025/09/2025_09.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ def solve_part1(points: list[Point]) -> int:
3232
return max(area(point1, point2) for point1, point2 in combinations(points, 2))
3333

3434

35+
def area(point1: Point, point2: Point) -> int:
36+
return (abs(point1.x - point2.x) + 1) * (abs(point1.y - point2.y) + 1)
37+
38+
3539
def solve_part2(points: list[Point]) -> int:
3640
original_to_compressed = compress_points(points)
3741
compressed_points = list(original_to_compressed.values())
@@ -100,10 +104,6 @@ def inside_polygon(
100104
return all_filled
101105

102106

103-
def area(point1: Point, point2: Point) -> int:
104-
return (abs(point1.x - point2.x) + 1) * (abs(point1.y - point2.y) + 1)
105-
106-
107107
if __name__ == "__main__":
108108
debug_mode = True
109109
# debug_mode = False

src/utils/data.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
import os
2-
3-
41
def load_data(debug: bool) -> str:
52
if debug:
6-
print(os.getcwd())
7-
83
with open("sample_input.txt") as f:
94
d = f.read()
105
else:
116
from aocd import data
7+
128
d = data
139
print(f"{len(d.splitlines())} lines read [debug={debug}]")
1410
return d

0 commit comments

Comments
 (0)