|
| 1 | +# Contributing to PULSE Protocol |
| 2 | + |
| 3 | +Thank you for your interest in contributing to PULSE Protocol! |
| 4 | + |
| 5 | +## Development Setup |
| 6 | + |
| 7 | +1. **Clone the repository**: |
| 8 | + ```bash |
| 9 | + git clone https://github.com/pulse-protocol/pulse-python.git |
| 10 | + cd pulse-python |
| 11 | + ``` |
| 12 | + |
| 13 | +2. **Create virtual environment**: |
| 14 | + ```bash |
| 15 | + python -m venv venv |
| 16 | + source venv/bin/activate # On Windows: venv\Scripts\activate |
| 17 | + ``` |
| 18 | + |
| 19 | +3. **Install dependencies**: |
| 20 | + ```bash |
| 21 | + pip install -r requirements.txt |
| 22 | + pip install -r requirements-dev.txt |
| 23 | + pip install -e . |
| 24 | + ``` |
| 25 | + |
| 26 | +## Development Workflow |
| 27 | + |
| 28 | +1. **Create a branch** for your feature or bugfix: |
| 29 | + ```bash |
| 30 | + git checkout -b feature/your-feature-name |
| 31 | + ``` |
| 32 | + |
| 33 | +2. **Write tests first** (TDD approach): |
| 34 | + - Add tests in `tests/` |
| 35 | + - Run tests: `pytest` |
| 36 | + |
| 37 | +3. **Implement your changes**: |
| 38 | + - Follow PEP 8 style guide |
| 39 | + - Use type hints |
| 40 | + - Add docstrings (Google style) |
| 41 | + |
| 42 | +4. **Run quality checks**: |
| 43 | + ```bash |
| 44 | + # Format code |
| 45 | + black pulse/ tests/ |
| 46 | + |
| 47 | + # Lint |
| 48 | + pylint pulse/ |
| 49 | + |
| 50 | + # Type check |
| 51 | + mypy pulse/ |
| 52 | + |
| 53 | + # Run tests with coverage |
| 54 | + pytest --cov=pulse --cov-report=html |
| 55 | + ``` |
| 56 | + |
| 57 | +5. **Commit your changes**: |
| 58 | + ```bash |
| 59 | + git add . |
| 60 | + git commit -m "feat: add your feature description" |
| 61 | + ``` |
| 62 | + |
| 63 | + Use conventional commits: |
| 64 | + - `feat:` - New feature |
| 65 | + - `fix:` - Bug fix |
| 66 | + - `docs:` - Documentation |
| 67 | + - `test:` - Tests |
| 68 | + - `refactor:` - Code refactoring |
| 69 | + |
| 70 | +6. **Push and create Pull Request**: |
| 71 | + ```bash |
| 72 | + git push origin feature/your-feature-name |
| 73 | + ``` |
| 74 | + |
| 75 | +## Code Style |
| 76 | + |
| 77 | +- **PEP 8** compliance |
| 78 | +- **Line length**: 100 characters |
| 79 | +- **Type hints**: Required for all functions |
| 80 | +- **Docstrings**: Required for all public APIs (Google style) |
| 81 | +- **Black** for formatting |
| 82 | +- **Pylint** for linting |
| 83 | + |
| 84 | +## Testing |
| 85 | + |
| 86 | +- **Coverage**: Minimum 90% overall, 95% for core modules |
| 87 | +- **Test types**: Unit, integration, performance, security |
| 88 | +- All tests must pass before PR merge |
| 89 | + |
| 90 | +## Questions? |
| 91 | + |
| 92 | +- Open an issue on GitHub |
| 93 | +- Join our Discord community |
| 94 | +- Email: dev@pulse-protocol.org |
| 95 | + |
| 96 | +Thank you for contributing! 🚀 |
0 commit comments