Skip to content

Commit cab40b9

Browse files
committed
add linting
1 parent d25ee3d commit cab40b9

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

Makefile

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Test/Dev
44
DEV_CMD=cd intbot && DJANGO_ENV="dev" uv run --env-file .env -- ./manage.py
55
TEST_CMD=cd intbot && DJANGO_SETTINGS_MODULE="intbot.settings" DJANGO_ENV="test" uv run pytest --nomigrations
6+
UV_RUN_DEV=cd intbot && DJANGO_ENV="dev" uv run
67

78
# Docker
89
DOCKER_RUN_WITH_PORT=docker run -p 4672:4672 --add-host=host.internal:host-gateway -e DJANGO_ENV="local_container" -it intbot:$(V)
@@ -20,6 +21,11 @@ help:
2021
# First target is dummy so we you won't run anything by accident
2122
@echo "Hello world!, Please check the file content for details"
2223

24+
25+
26+
# Local development
27+
# =================
28+
2329
server:
2430
$(DEV_CMD) runserver 0.0.0.0:4672
2531

@@ -32,18 +38,40 @@ migrate:
3238
migrations:
3339
$(DEV_CMD) makemigrations -n $(N)
3440

41+
bot:
42+
$(DEV_CMD) run_bot
43+
44+
45+
# Test, lint, etc
46+
# ================
47+
3548
test:
3649
$(TEST_CMD) -s -vv
3750

38-
bot:
39-
$(DEV_CMD) run_bot
51+
52+
lint:
53+
# '.' because UV_RUN_DEV implies cd to intbot/
54+
$(UV_RUN_DEV) ruff check .
55+
56+
lint/fix:
57+
# '.' because UV_RUN_DEV implies cd to intbot/
58+
$(UV_RUN_DEV) ruff check --fix .
59+
60+
format:
61+
# '.' because UV_RUN_DEV implies cd to intbot/
62+
$(UV_RUN_DEV) ruff format .
63+
64+
type-check:
65+
$(UV_RUN_DEV) mypy intbot/
66+
4067

4168

4269
client/send_test_webhook:
4370
uv run client/send_test_webhook.py
4471

4572

4673
# Targets to be run inside the container (for build/prod/deployments)
74+
# ===================================================================
4775

4876
in-container/collectstatic:
4977
DJANGO_ENV="build" python intbot/manage.py collectstatic --noinput
@@ -60,6 +88,7 @@ in-container/migrate:
6088

6189

6290
# Docker management targets
91+
# =========================
6392

6493
docker/build:
6594
docker build . -t intbot:$(current_git_hash)
@@ -69,7 +98,8 @@ docker/run/gunicorn:
6998

7099

71100
# Deploymenet targets
72-
#
101+
# ====================
102+
73103
deploy/provision:
74104
$(DEPLOY_CMD) playbooks/01_setup.yml
75105
$(DEPLOY_CMD) playbooks/02_nginx.yml

intbot/core/endpoints/webhooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def internal_webhook_endpoint(request):
2828
def verify_internal_webhook(request):
2929
"""raise ValueError if incorrect token"""
3030

31-
if not "Authorization" in request.headers:
31+
if "Authorization" not in request.headers:
3232
raise ValueError("Authorization token is missing")
3333

3434
token = request.headers['Authorization']

0 commit comments

Comments
 (0)