Skip to content

Commit a481214

Browse files
authored
docs: add contribution guidelines (#110)
1 parent 278ce4c commit a481214

3 files changed

Lines changed: 77 additions & 8 deletions

File tree

CONTRIBUTING.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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.

CONTRIBUTORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ We would like to thank these people for their valuable contributions:
1717

1818
We welcome and appreciate all contributions! Whether you're fixing bugs, adding features, improving documentation, or helping with ideas and feedback, your contributions make rustnet better.
1919

20-
See our [README](README.md) for information on how to get started.
20+
See our [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute.

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,7 @@ See [USAGE.md](USAGE.md) for complete timeout details.
251251

252252
## Contributing
253253

254-
Contributions are welcome! Please:
255-
256-
1. Fork the repository
257-
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
258-
3. Commit your changes (`git commit -m 'Add amazing feature'`)
259-
4. Push to the branch (`git push origin feature/amazing-feature`)
260-
5. Open a Pull Request
254+
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute.
261255

262256
See [CONTRIBUTORS.md](CONTRIBUTORS.md) for a list of people who have contributed to this project.
263257

0 commit comments

Comments
 (0)