Skip to content

Commit

Permalink
add github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nrlulz committed Dec 9, 2023
1 parent ee0465c commit 05c88d8
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 56 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test

on:
push:
branches:
- master
pull_request:
branches:
- master

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry==1.7.1
- uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: "poetry"
- name: Install dependencies
run: poetry install
- uses: pre-commit/[email protected]
- name: Run flake8
run: poetry run ruff .
- name: Run pyright
run: poetry run pyright .
4 changes: 2 additions & 2 deletions aoc2023/day2.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ def minimum_subset(self):
)


games = []
games: list[Game] = []

for line in lines:
game_id, rest = line.split(":")
_, game_id = game_id.split()

subsets = []
subsets: list[GameSubset] = []

for subset in rest.split("; "):
kwargs = {
Expand Down
2 changes: 1 addition & 1 deletion aoc2023/day3.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
with open(base_dir / "day3_input.txt") as f:
lines = f.read().splitlines()

part_numbers = []
part_numbers: list[int] = []

not_symbols = ".0123456789"

Expand Down
164 changes: 112 additions & 52 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,23 @@ readme = "README.md"
version = "0.0.1"

[tool.poetry.dependencies]
advent-of-code-data = "^2.0.1"
python = "^3.12"

[tool.poetry.group.dev.dependencies]
black = "^23.11.0"
mypy = "^1.7.1"
pre-commit = "^3.5.0"
pyright = "^1.1.339"
pytest = "^7.4.3"
ruff = "^0.1.6"

[tool.pyright]
strict = ["**/*.py"]

[tool.ruff.per-file-ignores]
"__init__.py" = [
# unused import
"F401",
# wildcard import
"F403"
]

0 comments on commit 05c88d8

Please sign in to comment.