|
| 1 | +# Contributing to CashPilot |
| 2 | + |
| 3 | +Contributions are welcome! Here's how to get started. |
| 4 | + |
| 5 | +## Adding a Service (easiest contribution) |
| 6 | + |
| 7 | +This is the most impactful way to contribute. Each service is a single YAML file. |
| 8 | + |
| 9 | +1. Create `services/{category}/{slug}.yml` following the schema in `services/_schema.yml` |
| 10 | +2. Add a guide page at `docs/guides/{slug}.md` with setup instructions |
| 11 | +3. Update the service table in `README.md` |
| 12 | +4. Submit a PR |
| 13 | + |
| 14 | +Look at any existing YAML file in `services/` for reference. Categories: `bandwidth`, `depin`, `storage`, `compute`. |
| 15 | + |
| 16 | +## Adding an Earnings Collector |
| 17 | + |
| 18 | +Collectors fetch balance/earnings from service APIs. See `app/collectors/` for examples. |
| 19 | + |
| 20 | +1. Create `app/collectors/{slug}.py` extending `BaseCollector` from `app/collectors/base.py` |
| 21 | +2. Register it in `app/collectors/__init__.py` |
| 22 | +3. Add required credentials as `?optional` or required params |
| 23 | + |
| 24 | +## Bug Fixes and Features |
| 25 | + |
| 26 | +1. Fork the repo and create a branch (`fix/description` or `feature/description`) |
| 27 | +2. Make your changes |
| 28 | +3. Run linting: `ruff check app/ && ruff format --check app/` |
| 29 | +4. Submit a PR with a clear description |
| 30 | + |
| 31 | +## Code Style |
| 32 | + |
| 33 | +- **Linter:** [Ruff](https://docs.astral.sh/ruff/) with pycodestyle, pyflakes, isort, pyupgrade, bugbear, simplify |
| 34 | +- **Line length:** 120 |
| 35 | +- **Formatting:** Ruff formatter (double quotes, 4-space indent) |
| 36 | + |
| 37 | +Run before committing: |
| 38 | + |
| 39 | +```bash |
| 40 | +ruff check app/ --fix |
| 41 | +ruff format app/ |
| 42 | +``` |
| 43 | + |
| 44 | +## Commit Messages |
| 45 | + |
| 46 | +Use conventional commits: `type(scope): description` |
| 47 | + |
| 48 | +Types: `feat`, `fix`, `docs`, `refactor`, `test`, `chore` |
| 49 | + |
| 50 | +Examples: |
| 51 | +- `feat(collector): add Bitping earnings collector` |
| 52 | +- `fix(deploy): handle missing Docker socket gracefully` |
| 53 | +- `docs(service): add ProxyBase setup guide` |
0 commit comments