|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +## Project Structure & Module Organization |
| 4 | +- `dp3/`: core Python package (processing engine, API, CLI utilities). |
| 5 | +- `modules/`: example app-specific modules/plugins. |
| 6 | +- `config/`: example/default configuration. |
| 7 | +- `install/` and `docker/`: deployment and container setup. |
| 8 | +- `tests/`: unit/integration tests (`tests/test_common`, `tests/test_api`, `tests/test_config`). |
| 9 | +- `docs/` and `mkdocs.yml`: documentation sources. |
| 10 | + |
| 11 | +## Build, Test, and Development Commands |
| 12 | +- `python -m venv venv && source venv/bin/activate`: local virtualenv. |
| 13 | +- `pip install --editable ".[dev]"`: install for platform development. |
| 14 | +- `pre-commit install`: enable formatting/linting hooks. |
| 15 | +- `docker compose up -d --build`: start MongoDB, RabbitMQ, Redis for local runs/tests. |
| 16 | +- `APP_NAME=my_app CONF_DIR=config dp3 api`: run API process. |
| 17 | +- `dp3 worker my_app config 0`: run a worker process. |
| 18 | +- `dp3 check <config_dir>`: validate configuration with detailed errors. |
| 19 | + |
| 20 | +## Documentation |
| 21 | +- When adding or changing user-visible features, configuration, CLI behavior, deployment flow, or extension points, update the relevant docs in `docs/` and `mkdocs.yml` as part of the same change. |
| 22 | +- Prefer keeping how-to guides, concept pages, and configuration reference pages aligned with code changes. |
| 23 | + |
| 24 | +## Coding Style & Naming Conventions |
| 25 | +- Formatting: Black with 100-char line length. |
| 26 | +- Linting: Ruff (with auto-fix in pre-commit). |
| 27 | +- Keep module/function names descriptive; prefer `snake_case` for Python identifiers. |
| 28 | +- Follow existing package layout under `dp3/` and test naming under `tests/`. |
| 29 | + |
| 30 | +## Testing Guidelines |
| 31 | +- Framework: `unittest`. |
| 32 | +- Common tests: |
| 33 | + `python -m unittest discover -s tests/test_common -v` |
| 34 | +- API tests (with config): |
| 35 | + `CONF_DIR=tests/test_config python -m unittest discover -s tests/test_api -v` |
| 36 | +- Add tests next to related area (`tests/test_common`, `tests/test_api`, or `tests/modules`). |
| 37 | + |
| 38 | +## Commit & Pull Request Guidelines |
| 39 | +- Commit messages use concise scope + summary, often `Scope: message`, e.g. |
| 40 | + `Docs: update callback registrar docstring` or `DB: fix unpacking of fulltext filters`. |
| 41 | +- Use `Breaking` or similar marker when removing/deprecating behavior, e.g. |
| 42 | + `API - Breaking: Removed deprecated parameter.` |
| 43 | +- PRs should include: summary, rationale, test evidence, linked issues/PRs when relevant, and a note on documentation updates when user-visible behavior changed. |
| 44 | + |
| 45 | +## Configuration & Services |
| 46 | +- Local runtime depends on MongoDB, RabbitMQ, and Redis (provided via `docker-compose.yml`). |
| 47 | +- Use `CONF_DIR` to point to config sets (e.g. `tests/test_config` for test runs). |
0 commit comments