Skip to content

Commit 43c68c2

Browse files
authored
Add initial setup (#1)
* Add initial setup * Add github workflows * fix pytest command * add 1 dummy test * Fix workflow names * add names --------- Co-authored-by: Thijs <[email protected]>
1 parent 24d3d9c commit 43c68c2

File tree

11 files changed

+386
-0
lines changed

11 files changed

+386
-0
lines changed

.github/workflows/lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
10+
jobs:
11+
lint_the_code:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Install poetry
16+
run: pipx install poetry
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: 3.12
20+
cache: "poetry"
21+
- run: poetry run python --version
22+
- run: poetry install
23+
- run: poetry run black .
24+
- run: poetry run isort .
25+
- run: poetry run ruff check .
26+
- run: poetry run pyright .

.github/workflows/test.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
10+
jobs:
11+
test_the_code:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Install poetry
16+
run: pipx install poetry
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: 3.12
20+
cache: "poetry"
21+
- run: poetry run python --version
22+
- run: poetry install
23+
- run: poetry run pytest

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
### Linux ###
2+
*~
3+
4+
### macOS ###
5+
.DS_Store
6+
7+
### Python ###
8+
__pycache__/
9+
10+
### PyCharm ###
11+
.idea/
12+
13+
### Visual Studio Code
14+
.vscode/

add_day.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Check if an argument is provided
4+
if [ $# -eq 0 ]; then
5+
echo "Usage: $0 <integer>"
6+
exit 1
7+
fi
8+
9+
day=$1
10+
11+
if ! [[ $day =~ ^[0-9]+$ ]]; then
12+
echo "Error: The provided day should be an integer."
13+
exit 1
14+
fi
15+
16+
mkdir adventofcode/day$day
17+
touch adventofcode/day$day/data.txt
18+
touch adventofcode/day$day/solution.py
19+
touch adventofcode/day$day/test_day$day.py

adventofcode/__init__.py

Whitespace-only changes.

adventofcode/day1/data.txt

Whitespace-only changes.

adventofcode/day1/solution.py

Whitespace-only changes.

adventofcode/day1/test_day1.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
def test_day1():
3+
pass

cleanup.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
poetry run black .
4+
poetry run isort .
5+
poetry run ruff check .
6+
poetry run pyright .

poetry.lock

Lines changed: 256 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)