Thank you for your interest in contributing to Memvid! We welcome contributions from everyone.
- Rust 1.85.0+ — Install from rustup.rs
- Git — For version control
-
Fork the repository on GitHub
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/memvid.git cd memvid -
Build the project:
cargo build
-
Run tests:
cargo test
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix- Write your code following the code style guidelines
- Add tests for new functionality
- Ensure all tests pass:
cargo test - Run clippy:
cargo clippy - Format code:
cargo fmt
Write clear, concise commit messages:
git commit -m "feat: add support for XYZ"
git commit -m "fix: resolve issue with ABC"
git commit -m "docs: update README examples"-
Push to your fork:
git push origin feature/your-feature-name
-
Open a Pull Request on GitHub
-
Fill out the PR template completely
-
Wait for review and address feedback
- Follow standard Rust idioms and conventions
- Use
rustfmtfor formatting (cargo fmt) - Use
clippyfor linting (cargo clippy). We maintain a zero-warning policy. - Prefer explicit types for public APIs
- Use
thiserrorfor error definitions
We enforce strict linting to ensure safety and portability:
- Zero Warnings: CI will fail on any warning. Run
cargo clippy --workspace --all-targets -- -D warningslocally. - No Panics:
unwrap()andexpect()are denied in library code. UseResultpropagation (?) or graceful error handling. They are allowed intests/. - No Truncation:
cast_possible_truncationis denied. Usetry_fromwhen convertingu64tousize/u32. - Exceptions: We allow pragmatic lints (e.g.,
cast_precision_lossfor ML math) insrc/lib.rs. Do not add global#![allow]without discussion.
- Add doc comments (
///) to all public functions, structs, and modules - Include examples in doc comments where helpful
- Keep comments concise and up-to-date
- Write unit tests for new functionality
- Place tests in the same file using
#[cfg(test)]module - Integration tests go in the
tests/directory - Aim for high coverage of edge cases
memvid/
├── src/ # Source code
│ ├── lib.rs # Public API
│ ├── memvid/ # Core implementation
│ ├── io/ # File I/O
│ └── types/ # Type definitions
├── tests/ # Integration tests
├── examples/ # Example code
├── benchmarks/ # Benchmarks
└── data/ # Required data files
When adding new functionality, consider if it should be behind a feature flag:
[features]
my_feature = ["dep:some-dependency"]This keeps the default build lean and fast.
When reporting bugs, please include:
- Rust version (
rustc --version) - Operating system
- Memvid version
- Minimal code to reproduce
- Expected vs actual behavior
Interested in translating Memvid's documentation? See Contributing Translations for guidelines on translating the README and other documentation.
- Open a Discussion for questions
- Check existing Issues for similar problems
- Email: contact@memvid.com
Contributors are:
- Listed in release notes
- Part of the Memvid community
Thank you for making Memvid better!