Thank you for your interest in contributing to Transmutation! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to maintain a respectful and inclusive environment for everyone.
- Rust nightly (1.85+)
- Git
- Familiarity with async Rust
- Clone the repository:
git clone https://github.com/hivellm/transmutation.git
cd transmutation- Install Rust nightly:
rustup install nightly
rustup default nightly- Build the project:
cargo build- Run tests:
cargo testgit checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix- Write clear, documented code
- Follow Rust conventions and idioms
- Add tests for new functionality
- Update documentation as needed
# Run all tests
cargo test
# Run specific test
cargo test test_name
# Run with all features
cargo test --all-features
# Run benchmarks
cargo bench# Format code
cargo fmt
# Run clippy
cargo clippy --all-features --all-targets -- -D warningsFollow conventional commits format:
feat: add support for EPUB format
fix: resolve memory leak in PDF parser
docs: update installation instructions
test: add integration tests for DOCX
perf: optimize Markdown generation
refactor: simplify error handling
git push origin your-branch-nameThen create a Pull Request on GitHub.
- Follow the Rust API Guidelines
- Use
rustfmtwith the project's configuration - Maximum line length: 100 characters
- Use meaningful variable names
- Add documentation comments for public APIs
- Document all public APIs with
///comments - Include examples in documentation
- Explain complex algorithms or logic
- Keep comments up to date with code
- Place tests in the same file as the code they test
- Use the
#[cfg(test)]attribute - Test edge cases and error conditions
- Aim for >80% code coverage
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_feature() {
// Test implementation
}
}- Place integration tests in
tests/directory - Test end-to-end workflows
- Use realistic test fixtures
- Add benchmarks for performance-critical code
- Use criterion for benchmarking
- Document performance expectations
- Create converter module in
src/converters/ - Implement
DocumentConvertertrait - Add format to
FileFormatenum - Add tests with sample files
- Update documentation
- Add variant to
OutputFormatenum - Implement generator in
src/output/ - Add conversion logic
- Add tests
- Update documentation
transmutation/
├── src/
│ ├── bin/ # CLI application
│ ├── converters/ # Format-specific converters
│ ├── engines/ # Core parsing engines
│ ├── output/ # Output generators
│ ├── types.rs # Core type definitions
│ ├── error.rs # Error types
│ └── lib.rs # Library entry point
├── tests/ # Integration tests
├── benches/ # Benchmarks
├── docs/ # Documentation
└── examples/ # Usage examples
- Profile before optimizing
- Use
cargo flamegraphfor performance analysis - Minimize allocations in hot paths
- Use appropriate data structures
- Consider parallel processing with
rayon
# Generate and open docs
cargo doc --open --all-features- Update
README.mdfor user-facing changes - Add examples to
examples/directory - Update
docs/for major features
- Update
CHANGELOG.md - Bump version in
Cargo.toml - Create git tag:
git tag -a v0.x.0 -m "Release v0.x.0" - Push tag:
git push origin v0.x.0 - GitHub Actions will handle the rest
- Open an issue for questions
- Join discussions in GitHub Discussions
- Check existing issues and PRs
By contributing, you agree that your contributions will be licensed under the MIT License.
Contributors will be recognized in the project's README and release notes.
Thank you for contributing to Transmutation! 🚀