Skip to content

Commit 02371d6

Browse files
committed
🔧 chore: improve task configuration and add new dev tools
Taskfile.yaml & toast.yml improvements: - Add pip-audit for security vulnerability scanning - Add code:lint and code:check tasks for ruff linting - Add dependencies:security and dependencies:tree tasks - Rename upgrade:package to dependencies:upgrade:package - Fix incorrect/missing task descriptions requirements/dev.in: - Add pip-audit dependency
1 parent b54dfce commit 02371d6

3 files changed

Lines changed: 58 additions & 10 deletions

File tree

Taskfile.yaml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dotenv: ['production.env']
1313

1414
tasks:
1515
database:drop:
16+
desc: Drop the local PostgreSQL database
1617
cmds:
1718
- docker compose exec -u postgres postgres dropdb --if-exists pythonie
1819

@@ -48,12 +49,12 @@ tasks:
4849
- docker compose run --remove-orphans --detach --service-ports postgres
4950

5051
run:
51-
desc: Run a local version of PythonIE (works)
52+
desc: Run a local version of PythonIE
5253
cmds:
5354
- docker compose run --rm --service-ports web python pythonie/manage.py runserver 0.0.0.0:8000
5455

5556
django:shell-plus:
56-
desc: Run a local version of PythonIE
57+
desc: Run Django shell_plus
5758
cmds:
5859
- docker compose run --rm web python pythonie/manage.py shell_plus
5960

@@ -68,12 +69,12 @@ tasks:
6869
- docker compose run --rm web python pythonie/manage.py makemigrations
6970

7071
django:migrate:
71-
desc: Make migrations
72+
desc: Run database migrations
7273
cmds:
7374
- docker compose run --rm web python pythonie/manage.py migrate
7475

7576
django:collect-static:
76-
desc: Make migrations
77+
desc: Collect static files
7778
cmds:
7879
- docker compose run --rm web python pythonie/manage.py collectstatic
7980

@@ -93,15 +94,25 @@ tasks:
9394
- toast deps:upgrade
9495

9596
dependencies:upgrade:django:
96-
desc: Upgrade the dependencies
97+
desc: Upgrade Django to the latest compatible version
9798
cmds:
9899
- toast deps:upgrade:django
99100

100101
dependencies:upgrade:wagtail:
101-
desc: Upgrade the dependencies
102+
desc: Upgrade Wagtail to the latest compatible version
102103
cmds:
103104
- toast deps:upgrade:wagtail
104105

106+
dependencies:security:
107+
desc: Check dependencies for known security vulnerabilities
108+
cmds:
109+
- toast deps:security
110+
111+
dependencies:tree:
112+
desc: Show the dependencies tree
113+
cmds:
114+
- toast deps:tree
115+
105116
docker:build:
106117
desc: Build the docker image
107118
cmds:
@@ -131,7 +142,19 @@ tasks:
131142
desc: Format the code
132143
cmds:
133144
- toast code:format
134-
upgrade:package:
145+
146+
code:lint:
147+
desc: Lint the code and fix issues
148+
cmds:
149+
- toast code:lint
150+
151+
code:check:
152+
desc: Check code formatting and linting without changes
153+
cmds:
154+
- toast code:check
155+
156+
dependencies:upgrade:package:
157+
desc: "Upgrade a specific package (usage: task dependencies:upgrade:package PACKAGE=django)"
135158
cmds:
136159
- python -m uv pip compile --upgrade-package $PACKAGE --output-file requirements/main.txt requirements/main.in
137160
- python -m uv pip compile --upgrade-package $PACKAGE --output-file requirements/dev.txt requirements/dev.in

requirements/dev.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ django-debug-toolbar
55
fakeredis
66
isort
77
model-mommy
8+
pip-audit
89
pipdeptree
910
ruff
1011
uv

toast.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ tasks:
2828
python -m uv pip compile --upgrade --output-file requirements/production.txt requirements/production.in
2929
3030
deps:upgrade:django:
31-
description: Upgrade the Django dependencies
31+
description: Upgrade Django to the latest compatible version
3232
cache: false
3333
mount_paths:
3434
- .:/app
@@ -39,7 +39,7 @@ tasks:
3939
python -m uv pip compile --upgrade-package django --output-file requirements/production.txt requirements/production.in
4040
4141
deps:upgrade:wagtail:
42-
description: Upgrade the Wagtail dependencies
42+
description: Upgrade Wagtail to the latest compatible version
4343
cache: false
4444
mount_paths:
4545
- .:/app
@@ -49,6 +49,11 @@ tasks:
4949
python -m uv pip compile --upgrade-package wagtail --output-file requirements/dev.txt requirements/dev.in
5050
python -m uv pip compile --upgrade-package wagtail --output-file requirements/production.txt requirements/production.in
5151
52+
deps:security:
53+
description: Check dependencies for known security vulnerabilities
54+
cache: false
55+
command: pip-audit
56+
5257
deps:tree:
5358
description: Show the dependencies tree
5459
cache: false
@@ -63,8 +68,27 @@ tasks:
6368
command: |
6469
python -m ruff format pythonie
6570
71+
code:lint:
72+
description: Lint the code and fix issues
73+
cache: false
74+
mount_paths:
75+
- .:/app
76+
location: /app
77+
command: |
78+
python -m ruff check --fix pythonie
79+
80+
code:check:
81+
description: Check code formatting and linting without changes
82+
cache: false
83+
mount_paths:
84+
- .:/app
85+
location: /app
86+
command: |
87+
python -m ruff format --check pythonie
88+
python -m ruff check pythonie
89+
6690
fish:
67-
description: Run a Shell
91+
description: Run a shell
6892
cache: false
6993
mount_paths:
7094
- .:/app

0 commit comments

Comments
 (0)