Contributing¶
See CONTRIBUTING.md for the full guide.
Quick Setup¶
git clone https://github.com/Cepat-Kilat-Teknologi/dawos-agent.git
cd dawos-agent
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pip install pylint black
Development Commands¶
pytest tests/ -x -q # Run tests
coverage run -m pytest tests/ # Run with coverage
coverage report -m # Coverage report
pylint dawos_agent/ # Lint (must be 10.00/10)
black --check dawos_agent/ tests/ # Format check
ruff check dawos_agent/ tests/ # Ruff lint
Pre-commit Hooks¶
Hooks run Black, Ruff, and Pylint automatically on git commit.
Quality Standards¶
- Black: line-length 88, target py39
- Pylint: must score 10.00/10
- Ruff: zero violations
- Coverage: minimum 90%
- pip-audit: zero known vulnerabilities
Adding a New Endpoint¶
- Add Pydantic models to
dawos_agent/models/schemas.py - Create service module in
dawos_agent/services/ - Create router in
dawos_agent/routers/with proper prefix and tags - Mount router in
dawos_agent/app.py - Write tests in
tests/ - Run all quality checks:
black dawos_agent/ tests/ && ruff check dawos_agent/ tests/ && pylint dawos_agent/ && pytest tests/ -x -q
Code Style¶
- Language: all code, comments, docstrings, and commits in English
- Docstrings: Google-style on all public functions and classes
- Type hints: required on all function signatures
- Imports:
from __future__ import annotationsat the top of every module
Commit Convention¶
Use Conventional Commits:
feat:-- new featurefix:-- bug fixdocs:-- documentation onlyrefactor:-- code change that neither fixes a bug nor adds a featuretest:-- adding or correcting testschore:-- maintenance tasks