|
| 1 | +# Contributing to rustnet |
| 2 | + |
| 3 | +Pull requests are very welcome! Whether you're fixing bugs, adding features, improving documentation, or providing feedback, all contributions help make rustnet better. |
| 4 | + |
| 5 | +## Development Workflow |
| 6 | + |
| 7 | +We use the standard open-source fork and feature branch approach: |
| 8 | + |
| 9 | +1. **Open an issue first** to discuss your proposed changes (for non-trivial work) |
| 10 | +2. Fork the repository |
| 11 | +3. Clone your fork locally |
| 12 | +4. Create a feature branch from `main` (`git checkout -b feature/your-feature`) |
| 13 | +5. Make your changes |
| 14 | +6. Push to your fork (`git push origin feature/your-feature`) |
| 15 | +7. Open a Pull Request against `main` and reference the related issue |
| 16 | + |
| 17 | +## Code Quality Requirements |
| 18 | + |
| 19 | +Before submitting a PR, please ensure: |
| 20 | + |
| 21 | +- **Unit tests**: Add tests for complex or critical code paths |
| 22 | +- **No dead code**: Remove unused code, imports, and dependencies |
| 23 | +- **Code style**: Follow the existing code style and patterns in the codebase |
| 24 | +- **Clippy**: Fix all clippy warnings |
| 25 | + ```bash |
| 26 | + cargo clippy --all-targets --all-features -- -D warnings |
| 27 | + ``` |
| 28 | +- **Formatting**: Run the formatter |
| 29 | + ```bash |
| 30 | + cargo fmt |
| 31 | + ``` |
| 32 | +- **Security audit**: Check for known vulnerabilities in dependencies |
| 33 | + ```bash |
| 34 | + cargo audit |
| 35 | + ``` |
| 36 | + |
| 37 | +## CI Checks |
| 38 | + |
| 39 | +When you open a PR, our CI pipeline will automatically run checks including: |
| 40 | + |
| 41 | +- Clippy lints |
| 42 | +- Code formatting verification |
| 43 | +- Build on multiple platforms |
| 44 | +- Test suite |
| 45 | + |
| 46 | +Please ensure all CI checks pass before requesting a review. |
| 47 | + |
| 48 | +## Dependency Policy |
| 49 | + |
| 50 | +Please be conservative with dependencies: |
| 51 | + |
| 52 | +- Don't add dependencies unless there's a good reason |
| 53 | +- Prefer standard library solutions when possible |
| 54 | +- If adding a dependency, explain the rationale in your PR description |
| 55 | +- Consider the dependency's maintenance status and security track record |
| 56 | + |
| 57 | +## Security |
| 58 | + |
| 59 | +Security is important for a network monitoring tool: |
| 60 | + |
| 61 | +- Keep security in mind when writing code |
| 62 | +- Avoid introducing common vulnerabilities (injection, buffer issues, etc.) |
| 63 | +- Be careful with user input and network data parsing |
| 64 | +- Report security issues responsibly (see [SECURITY.md](SECURITY.md)) |
| 65 | + |
| 66 | +## PR Guidelines |
| 67 | + |
| 68 | +- Write a clear description of what your changes do and why |
| 69 | +- Link any related issues |
| 70 | +- Keep PRs focused - one feature or fix per PR |
| 71 | +- Be responsive to review feedback |
| 72 | + |
| 73 | +## Questions? |
| 74 | + |
| 75 | +Feel free to open an issue if you have questions or want to discuss a potential contribution before starting work. |
0 commit comments