Skip to content

Commit

Permalink
Merge pull request #60 from marcelblijleven/chore/cleanup
Browse files Browse the repository at this point in the history
Chore/cleanup
  • Loading branch information
marcelblijleven authored Dec 2, 2023
2 parents e2482e2 + 35c45ed commit 045ed00
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 31 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ jobs:
run: hatch run test-cov
- name: "Upload coverage to Codecov"
if: matrix.python-version == 3.12 # Only upload coverage once per run
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
fail_ci_if_error: false

token: ${{ secrets.CODECOV_TOKEN }}
20 changes: 0 additions & 20 deletions .versionrc

This file was deleted.

9 changes: 1 addition & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
.PHONY: all install clean_project

all: clean_project install

install:
pip install -r requirements_dev.txt
cp pre-commit.template .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
.PHONY: clean_project

clean_project:
find . \( -type f -name '*.pyc' -or -type d -name '__pycache__' \) -delete
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ dependencies = [
"httpx",
"coverage[toml]>=6.5",
"pytest",
"pytest-cov",
"pytest-mock>=3.10",
]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
test-cov = "coverage run -m pytest --cov {args:tests} "
cov-report = [
"- coverage combine",
"coverage report",
Expand Down
6 changes: 6 additions & 0 deletions src/adventofcode/year_2023/day_01_2023.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def get_calibration_value(line: str) -> int:
if left is None:
left = char

if left is None or right is None:
raise ValueError("invalid state")

return int(left + right)


Expand All @@ -50,6 +53,9 @@ def get_calibration_value_with_words(line: str) -> int:
right = value
right_idx = rfind

if left is None or right is None:
raise ValueError("invalid state")

return int(left + right)


Expand Down

0 comments on commit 045ed00

Please sign in to comment.