Files
ctfd-cheaters/Makefile
Matte23andClaude Opus 5.5 e54d98498c test: Test suite against CTFd's own test app, lint tooling
- plugin_tests/: 9 tests running the plugin inside CTFd 3.8.9's test app
  (users and teams mode): own/shared flags, single reports, admins,
  invalid owners and empty flags, teams, create_flag_if_missing, the
  admin flag form, the admin page and dismissing.
- make venv (uv, Python 3.11), make lint, make format, make test: same
  tools and versions as ctfd-whale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 10:21:53 +01:00

26 lines
904 B
Makefile

# Same lint tools and rules as CTFd 3.8.9 (see CTFd's Makefile and linting.txt).
# Setup: make venv (needs uv; Python 3.11 like CTFd's Docker image)
VENV ?= .venv/bin
CTFD_PATH ?= ../CTFd
PYTHON ?= 3.11
venv:
uv venv --python $(PYTHON) .venv
uv pip install --python .venv/bin/python -r $(CTFD_PATH)/requirements.txt -r dev-requirements.txt
lint:
$(VENV)/ruff check --select E,F,W,B,C4,I --ignore E402,E501,E712,B904,B905,I001 --exclude=.venv .
$(VENV)/isort --profile=black --check-only --skip=.venv .
$(VENV)/black --check --diff --exclude=.venv .
format:
$(VENV)/isort --profile=black --skip=.venv .
$(VENV)/black --exclude=.venv .
# Runs inside CTFd's own test app, with the plugin loaded from this
# checkout; CTFD_PATH must be a checkout of the CTFd version it targets.
test:
CTFD_PATH=$(CTFD_PATH) $(VENV)/pytest -c plugin_tests/pytest.ini plugin_tests
.PHONY: venv lint format test