# Contributing to rustici
Thank you for your interest in contributing to **rustici**! π
We welcome all forms of contributions, whether it is a bug report, documentation improvement, feature request, or code.
This guide outlines the process to help you get started.
---
## π Code of Conduct
We are committed to fostering a welcoming, inclusive, and respectful community. Please:
- Be respectful and considerate in all interactions
- Provide constructive criticism and helpful feedback
- Respect differing viewpoints and experiences
---
## π How Can I Contribute?
### Reporting Issues
Before opening a new issue:
1. Search existing issues to avoid duplicates
2. Use the provided templates when possible
3. Include **relevant details**:
- Rust version (`rustc --version`)
- Operating system and environment
- Steps to reproduce
- Expected vs. actual behavior
- Error messages/logs
### Suggesting Enhancements
- Use the **feature request template**
- Clearly explain your use case and motivation
- Ensure it aligns with the projectβs **minimal and focused approach**
### Contributing Code
We welcome contributions that:
- Fix bugs π
- Add or improve tests π§ͺ
- Improve documentation π
- Introduce new features aligned with project goals β¨
- Enhance performance or code quality β‘
---
## π Development Setup
```bash
# Clone the repository
git clone https://github.com/mira-mobility/rustici.git
cd rustici
# Build the project
cargo build
# Run tests
cargo test
cargo test --all-features
# Check formatting
cargo fmt --all -- --check
# Run lints
cargo clippy --all-targets --all-features -- -D warnings
# Build documentation
cargo doc --open
```
---
## π Development Guidelines
### Code Standards
- **No unsafe code** β enforced with `#![forbid(unsafe_code)]`
- **Documentation required** β enforced with `#![deny(missing_docs)]`
- **Style** β Run `cargo fmt` before committing
- **Lint clean** β Pass `cargo clippy` with zero warnings
- **Test coverage** β Add tests for all new functionality
### Commit Messages
Use [Conventional Commits](https://www.conventionalcommits.org/):
```
type(scope): short description
Longer explanation if needed.
Fixes #123
```
**Types:** `feat`, `fix`, `docs`, `test`, `refactor`, `perf`, `chore`, `ci`
### Testing
- **Unit tests** β co-located in the same file under `#[cfg(test)]`
- **Integration tests** β in `tests/`
- **Examples** β in `examples/` (runnable via `cargo run --example <name>`)
- Ensure tests pass on **stable**, **beta**, and **nightly**
### Documentation
- All public items must have rustdoc comments
- Add runnable examples where helpful (` /// ```rust `)
- Update **README.md** for significant changes
- Keep comments concise but informative
---
## π Pull Request Process
1. **Fork and branch** β branch from `main`
2. **Implement changes** β follow guidelines above
3. **Test thoroughly** β run full test suite
4. **Update docs** β including README if needed
5. **Open PR** β use the PR template
6. **CI checks must pass** β
7. **Code review** β address feedback constructively
8. **Squash if requested** β keep history clean
### β
PR Checklist
- [ ] Code formatted & linted (`cargo fmt`, `cargo clippy`)
- [ ] Tests added/updated and passing
- [ ] Documentation updated
- [ ] No new warnings introduced
- [ ] Clear commit messages (conventional commits)
- [ ] PR description explains the change
---
## π Project Architecture
### Key Components
- `src/wire.rs` β Message encoding/decoding (sections, lists, key-values)
- `src/packet.rs` β Packet layer definitions
- `src/client.rs` β Synchronous UNIX socket client
- `src/error.rs` β Error types
### Design Principles
1. **Minimal dependencies** β Avoid external dependencies
2. **Pure Rust** β no FFI
3. **Blocking I/O** β synchronous by design
4. **UNIX-only** β targets UNIX domain sockets
5. **Protocol-focused** β implements wire protocol, not abstractions
---
## βοΈ Legal
### License
This project is licensed under **LGPL-2.1+**.
By contributing, you agree that:
- Your contributions are licensed under the same terms
- You have the right to submit the work
- You understand the implications of LGPL licensing
### Sign-off (Optional)
You may sign off commits with:
```
Signed-off-by: Your Name <your.email@example.com>
```
This indicates agreement with the [Developer Certificate of Origin](https://developercertificate.org/).
---
## π Need Help?
- Review existing documentation and examples
- Check closed issues for similar discussions
- Open a **discussion issue** if youβre unsure about an approach
- Contact maintainers (see README)
---
## π Recognition
- Contributors are acknowledged in **release notes**
- Significant contributions may be highlighted in the **README**
Thank you for helping make **rustici** better!