First off, thanks for taking the time to contribute! 🎉
The following is a set of guidelines for contributing to zParse. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
- Fork the repository
- Create a new branch for your changes
- Make your changes
- Submit a pull request
-
Issues First: Each pull request MUST be associated with an issue
- If an issue doesn't exist, create one first
- Reference the issue in your PR using GitHub's keywords (e.g., "Fixes #123")
-
Code Formatting: All code must be formatted using
rustfmt
cargo +nightly fmt --all
-
Clippy Lints: ALl code must pass clippy lints
cargo clippy --all-features --all-targets -- -D warnings
-
Commit Messages: Must follow the Conventional Commits format
type(scope): description [optional body] [optional footer]
Types:
feat
,fix
,docs
,style
,refactor
,perf
,test
,chore
Examples:
feat(parser): add support for nested arrays fix(converter): handle null values in JSON to TOML conversion docs(README): update installation instructions
-
Update tests
- Add new tests for new features
- Modify existing tests for changes to existing functionality
-
Update documentation
- Update relevant README sections
- Add/update doc comments for public API changes
- Update CHANGELOG.md following Keep a Changelog format
-
Pass all checks
- All tests must pass:
cargo test
- Benchmarks must run successfully:
cargo bench
- No clippy warnings:
cargo clippy --all-features -- -D warnings
- No unsafe code:
#![forbid(unsafe_code)]
- All tests must pass:
-
Create Issue
- Describe the problem/feature
- Get feedback from maintainers
- Wait for approval/assignment
-
Development
# Update your fork git checkout main git pull upstream main # Create feature branch git checkout -b feat/your-feature # Make changes # Write tests # Update docs
-
Testing
# Run tests cargo test --all-features # Run clippy cargo clippy --all-features -- -D warnings # Run benchmarks cargo bench # Run fuzzing (requires nightly) cargo +nightly fuzz run json_parser cargo +nightly fuzz run toml_parser
-
Submit PR
- Follow PR template
- Respond to review comments
- Keep your PR updated with the target branch
- Follow Rust standard conventions
- Use meaningful variable names
- Comment complex logic
- Keep functions focused and small
- Use type safety where possible
- Avoid unnecessary allocations
- Handle errors appropriately
Feel free to:
- Open an issue for discussion
- Ask questions in PR comments
By contributing, you agree that your contributions will be licensed under the GPL-3.0 License.