|
| 1 | +# Contributing to ServiceStack Rust |
| 2 | + |
| 3 | +Thank you for your interest in contributing to the ServiceStack Rust client library! |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +1. Fork the repository |
| 8 | +2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/servicestack-rust.git` |
| 9 | +3. Create a branch: `git checkout -b feature/your-feature-name` |
| 10 | + |
| 11 | +## Development Setup |
| 12 | + |
| 13 | +### Prerequisites |
| 14 | + |
| 15 | +- Rust 1.70 or later |
| 16 | +- Cargo (comes with Rust) |
| 17 | + |
| 18 | +### Building the Project |
| 19 | + |
| 20 | +```bash |
| 21 | +cargo build |
| 22 | +``` |
| 23 | + |
| 24 | +### Running Tests |
| 25 | + |
| 26 | +```bash |
| 27 | +# Run all tests |
| 28 | +cargo test |
| 29 | + |
| 30 | +# Run with output |
| 31 | +cargo test -- --nocapture |
| 32 | + |
| 33 | +# Run specific test |
| 34 | +cargo test test_name |
| 35 | +``` |
| 36 | + |
| 37 | +### Running Examples |
| 38 | + |
| 39 | +```bash |
| 40 | +cargo run --example basic_usage |
| 41 | +cargo run --example complete_example |
| 42 | +``` |
| 43 | + |
| 44 | +## Code Quality |
| 45 | + |
| 46 | +Before submitting a PR, please ensure: |
| 47 | + |
| 48 | +### 1. Format your code |
| 49 | + |
| 50 | +```bash |
| 51 | +cargo fmt |
| 52 | +``` |
| 53 | + |
| 54 | +### 2. Check for linting issues |
| 55 | + |
| 56 | +```bash |
| 57 | +cargo clippy -- -D warnings |
| 58 | +``` |
| 59 | + |
| 60 | +### 3. All tests pass |
| 61 | + |
| 62 | +```bash |
| 63 | +cargo test |
| 64 | +``` |
| 65 | + |
| 66 | +### 4. Build in release mode |
| 67 | + |
| 68 | +```bash |
| 69 | +cargo build --release |
| 70 | +``` |
| 71 | + |
| 72 | +## Pull Request Process |
| 73 | + |
| 74 | +1. Update the README.md with details of changes if applicable |
| 75 | +2. Add tests for any new functionality |
| 76 | +3. Ensure all tests pass |
| 77 | +4. Update examples if the API has changed |
| 78 | +5. Write clear commit messages |
| 79 | +6. Create a pull request with a clear description of the changes |
| 80 | + |
| 81 | +## Code Style |
| 82 | + |
| 83 | +- Follow Rust naming conventions |
| 84 | +- Use meaningful variable and function names |
| 85 | +- Add documentation comments for public APIs |
| 86 | +- Keep functions focused and small |
| 87 | +- Write tests for new features |
| 88 | + |
| 89 | +## Adding New Features |
| 90 | + |
| 91 | +When adding new features: |
| 92 | + |
| 93 | +1. Add unit tests in the relevant module |
| 94 | +2. Add integration tests in the `tests/` directory if needed |
| 95 | +3. Update documentation and examples |
| 96 | +4. Consider backward compatibility |
| 97 | + |
| 98 | +## Reporting Issues |
| 99 | + |
| 100 | +When reporting issues, please include: |
| 101 | + |
| 102 | +- Rust version (`rustc --version`) |
| 103 | +- Operating system |
| 104 | +- Minimal code example that reproduces the issue |
| 105 | +- Expected behavior |
| 106 | +- Actual behavior |
| 107 | + |
| 108 | +## Questions? |
| 109 | + |
| 110 | +Feel free to open an issue for any questions about contributing. |
| 111 | + |
| 112 | +Thank you for contributing to ServiceStack Rust! |
0 commit comments