Skip to content

Commit e96bc8c

Browse files
committed
🔧Trying to fix some mypy stuff.. First attempts at CI!
1 parent 799be61 commit e96bc8c

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

__init__.py

Whitespace-only changes.

aoc_15/solutions/day01.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@
1212
DATA: str = input_for_day(1, 2015)
1313

1414

15-
def helperfunction(data) -> accumulate[int]:
15+
def helperfunction(data: str) -> accumulate[int]:
1616
floors: accumulate[int] = accumulate(
1717
1 if x == '(' else -1 for x in data
1818
)
1919
return floors
2020

2121

2222
@report_results
23-
def solveday(data) -> tuple[int, int]:
23+
def solveday(data: str) -> tuple[int, int]:
2424
p1: int = sum(1 if x == '(' else -1 for x in data)
2525
p2: int = list(helperfunction(data)).index(-1)
2626
return p1, p2+1
2727

2828

29-
expected_test_results = (3, 1)
29+
expected_test_results: tuple[int, int] = (3, 1)
3030

3131

3232
@report_results
33-
def tests(test_input):
33+
def tests(test_input: str) -> None:
3434
p1, p2 = solveday(test_input)
3535
assert (p1, p2) == expected_test_results
3636
print("☑️ Tests passed!")

aoc_15/solutions/day02.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def wrapping_paper(dim: str) -> int:
2121
smallest side extra wrapping
2222
"""
2323
length, w, h = parse_dims(dim)
24-
sqft = (2*length*w + 2*w*h + 2*h*length)
25-
smallest_side = min([length*w, w*h, h*length])
24+
sqft: int = (2*length*w + 2*w*h + 2*h*length)
25+
smallest_side: int = min([length*w, w*h, h*length])
2626
return sqft + smallest_side
2727

2828

@@ -36,8 +36,8 @@ def ribbon(dim: str) -> int:
3636
int: ribbon length including bow
3737
"""
3838
length, w, h = parse_dims(dim)
39-
shdst = 2 * sum(sorted((length, w, h))[:2])
40-
bow = length * w * h
39+
shdst: int = 2 * sum(sorted((length, w, h))[:2])
40+
bow: int = length * w * h
4141
return shdst + bow
4242

4343

@@ -47,8 +47,8 @@ def parse_dims(dims: str) -> map[int]:
4747

4848
@report_results
4949
def solveday(data) -> tuple[int, int]:
50-
p1 = sum(wrapping_paper(x) for x in data)
51-
p2 = sum(ribbon(x) for x in data)
50+
p1: int = sum(wrapping_paper(x) for x in data)
51+
p2: int = sum(ribbon(x) for x in data)
5252
return p1, p2
5353

5454

aoc_15/solutions/day03.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from utils.aoc_utils import input_for_day, report_results
33

44

5-
EXAMPLE = []
5+
EXAMPLE: list = []
66
DATA = input_for_day(3)
77

88

0 commit comments

Comments
 (0)