Add ruff config and document Postgres test run
- Lint rules (pycodestyle, pyflakes, bugbear, isort, pyupgrade, bandit) in pyproject.toml; ruff pinned in requirements-dev - Full suite verified against PostgreSQL (embedded pgserver), plus a production-like check: collectstatic with manifest storage, fresh migrations, ensure_admin and all main pages with DEBUG off Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f96cbe965e
commit
aec254518c
@@ -53,6 +53,10 @@ no JS build step: plain forms with small progressive enhancements in `static/js/
|
|||||||
```bash
|
```bash
|
||||||
# Local (Windows dev box: venv lives at C:\Users\kyled\.venvs\kochbuch due to path-length issues)
|
# Local (Windows dev box: venv lives at C:\Users\kyled\.venvs\kochbuch due to path-length issues)
|
||||||
python -m pytest # tests (SQLite)
|
python -m pytest # tests (SQLite)
|
||||||
|
python -m ruff check . # lint (config in pyproject.toml)
|
||||||
|
# Postgres without Docker (dev box): pip install pgserver; start it, then
|
||||||
|
# POSTGRES_HOST=127.0.0.1 POSTGRES_PORT=<port> POSTGRES_USER=postgres POSTGRES_DB=postgres python -m pytest
|
||||||
|
# (the Windows pgserver build lacks tz data: copy tzdata/zoneinfo to pginstall/share/postgresql/timezone)
|
||||||
python scripts/dev_server.py # http://localhost:8000, [email protected]
|
python scripts/dev_server.py # http://localhost:8000, [email protected]
|
||||||
SECRET_KEY=dev python manage.py makemigrations
|
SECRET_KEY=dev python manage.py makemigrations
|
||||||
|
|
||||||
|
|||||||
@@ -7,3 +7,15 @@ requires-python = ">=3.12"
|
|||||||
DJANGO_SETTINGS_MODULE = "config.settings_test"
|
DJANGO_SETTINGS_MODULE = "config.settings_test"
|
||||||
testpaths = ["tests"]
|
testpaths = ["tests"]
|
||||||
addopts = "-q"
|
addopts = "-q"
|
||||||
|
|
||||||
|
[tool.ruff]
|
||||||
|
line-length = 120
|
||||||
|
extend-exclude = ["*/migrations/*"]
|
||||||
|
|
||||||
|
[tool.ruff.lint]
|
||||||
|
select = ["E", "F", "W", "B", "I", "UP", "S"]
|
||||||
|
ignore = ["E501", "S311"]
|
||||||
|
|
||||||
|
[tool.ruff.lint.per-file-ignores]
|
||||||
|
"tests/*" = ["S101", "S104", "S105", "S106"]
|
||||||
|
"recipes/schema_org.py" = ["S110"] # malformed third-party HTML must never break an import
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
-r requirements.txt
|
-r requirements.txt
|
||||||
pytest==9.2.0
|
pytest==9.2.0
|
||||||
pytest-django==4.14.0
|
pytest-django==4.14.0
|
||||||
|
ruff==0.17.3
|
||||||
|
|||||||
Reference in New Issue
Block a user