-
Notifications
You must be signed in to change notification settings - Fork 3
/
justfile
38 lines (30 loc) · 1.06 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# manualy update this
YEAR := "2024"
_default:
just --list
# error out if this isn't being run in a venv
_require-venv:
#!/usr/bin/env python
import sys
sys.exit(sys.prefix == sys.base_prefix)
# install dev deps
@install: _require-venv
# extra flags make this ~ as fast as I want
pip install -r requirements.txt --quiet --disable-pip-version-check
# run linting and typecheking over the solutions
@lint: _require-venv install
ruff check --quiet
ruff format --check --quiet
pyright
# run every solution for a given year
@validate year:
for i in $(seq 1 25); do ./advent $i --slow --year {{year}}; echo; done;
# run the dev server for the blog
@dev:
just --justfile blog/justfile dev
# add all and commit with message "{{year}} day {{day}}"
@commit day year=YEAR:
gg "{{year}} day {{day}}"
# open all the relevant files for a given day. Hardcodes the current year.
@open day:
code -r solutions/{{YEAR}}/day_$(printf %02d {{day}})/solution.py solutions/{{YEAR}}/day_$(printf %02d {{day}})/input.t* blog/src/content/writeups/{{YEAR}}/{{day}}/index.md