Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 6m9s
CI/CD Pipeline / Security Scanning (push) Successful in 26s
CI/CD Pipeline / Tests (3.11) (push) Failing after 5m24s
CI/CD Pipeline / Tests (3.12) (push) Failing after 5m23s
CI/CD Pipeline / Build Docker Image (push) Has been skipped
CI/CD Pipeline / Deploy to Staging (push) Has been skipped
CI/CD Pipeline / Deploy to Production (push) Has been skipped
CI/CD Pipeline / Notification (push) Successful in 1s
2.3 KiB
2.3 KiB
Repository Guidelines
Project Structure & Module Organization
src/guardden/is the main package:bot.py(bot lifecycle),cogs/(Discord commands/events),services/(business logic),models/(SQLAlchemy models),config.py(settings), andutils/(shared helpers).tests/holds pytest suites (test_*.py) for services and utilities.migrations/andalembic.inidefine database migrations.docker-compose.ymlandDockerfilesupport containerized development/deployments..env.exampleprovides the configuration template.
Build, Test, and Development Commands
pip install -e ".[dev,ai]"installs dev tooling plus optional AI providers.python -m guarddenruns the bot locally.pytestruns the full test suite;pytest tests/test_verification.py::TestVerificationService::test_verify_correctruns a single test.ruff check src testslints;ruff format src testsformats.mypy srcruns strict type checks.docker compose up -dstarts the full stack;docker compose up db -dstarts only Postgres.
Coding Style & Naming Conventions
- Python 3.11 with 4-space indentation; keep lines within 100 chars (Ruff config).
- Prefer type hints and clean async patterns; mypy runs in strict mode.
- Naming:
snake_casefor modules/functions,CamelCasefor classes,UPPER_SNAKEfor constants. - New cogs live in
src/guardden/cogs/and should be wired in_load_cogs()insrc/guardden/bot.py.
Testing Guidelines
- Tests use pytest + pytest-asyncio (
asyncio_mode=auto). - Follow
test_*.pyfile names andtest_*function names; group related cases inTest*classes. - Add or update tests for new services, automod rules, or AI provider behavior.
Commit & Pull Request Guidelines
- Commit messages are short, imperative, and capitalized (e.g.,
Fix: initialize guild config...,Add Discord bot setup...). - PRs should include a concise summary, tests run, and any config or migration notes; link related issues when available.
Security & Configuration Tips
- Store secrets in
.env(never commit); configuration keys are prefixed withGUARDDEN_. - PostgreSQL is required; default URL is
postgresql://guardden:guardden@localhost:5432/guardden. - AI features require
GUARDDEN_AI_PROVIDERplus the matching API key.