|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +## Project Structure & Module Organization |
| 4 | +- `src/cryptoservice/`: core package with async services, storage, and models grouped by domain (clients, services, storage, utils). |
| 5 | +- `tests/`: pytest suite mirroring package layout; async fixtures live in `tests/__init__.py`. |
| 6 | +- `docs/` and `mkdocs.yml`: MkDocs-driven documentation. |
| 7 | +- `scripts/`: automation helpers such as `prepare_release.py` for versioning and release branches. |
| 8 | +- `demo/` and `examples/`: runnable usage samples; keep them in sync with public APIs when adding features. |
| 9 | + |
| 10 | +## Build, Test, and Development Commands |
| 11 | +- `python3 -m pip install -e .[dev-all]`: install project plus dev tools (via uv or pip). |
| 12 | +- `ruff format && ruff check`: format/lint code to repository standards. |
| 13 | +- `pytest -v --cov=src/cryptoservice`: run the async test suite with coverage details. |
| 14 | +- `python3 scripts/prepare_release.py <version> --auto --push`: create release branch, run tests, tag, and push once the tree is clean. |
| 15 | + |
| 16 | +## Coding Style & Naming Conventions |
| 17 | +- Python ≥3.10 with async-first design; prefer `async/await` and type hints everywhere. |
| 18 | +- Follow Ruff defaults: 120-character lines, double quotes, spaces for indentation. |
| 19 | +- Keep modules small and feature-focused; filenames use snake_case, classes use PascalCase, constants uppercase. |
| 20 | +- Run `ruff check --fix` before committing to catch security and style issues early. |
| 21 | + |
| 22 | +## Testing Guidelines |
| 23 | +- Tests rely on `pytest`, `pytest-asyncio`, and coverage; new code should include async tests mirroring service behavior. |
| 24 | +- Name test files `tests/test_*.py`; structure tests to reflect module boundaries (e.g., `services` tests in `tests/test_services.py`). |
| 25 | +- For regression coverage, add parametrized cases rather than duplicating fixtures; update expected artifacts in `data/` sparingly and document any large fixtures. |
| 26 | + |
| 27 | +## Commit & Pull Request Guidelines |
| 28 | +- Use Conventional Commits (`feat`, `fix`, `docs`, `chore`, etc.); release commits are generated by `prepare_release.py`. |
| 29 | +- PRs should explain motivation, link issues, and list manual verification (tests run, docs updated). Include screenshots or logs when touching demos. |
| 30 | +- Keep PRs focused: refactors separate from feature work; update docs/examples alongside code changes. |
| 31 | + |
| 32 | +## Security & Configuration Tips |
| 33 | +- Secrets live in `.env` (e.g., `BINANCE_API_KEY`, `BINANCE_API_SECRET`); never commit real credentials. |
| 34 | +- When adding integrations, document required environment variables in `docs/` and provide safe defaults for local runs. |
0 commit comments