Contributing to Rive
Thank you for your interest in contributing to Rive! This guide will help you get started.
Getting Startedâ
Prerequisitesâ
- Rust (latest stable version)
- Git
- Basic knowledge of compiler design (recommended)
Setting Up Development Environmentâ
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/your-username/rive.git
cd rive
- Build the project:
cargo build
- Run tests:
cargo test
Areas for Contributionâ
Compiler Developmentâ
- Lexer: Tokenization improvements
- Parser: Syntax tree construction
- Semantic Analysis: Type checking, name resolution
- Code Generation: LLVM IR generation
- Error Messages: Better error reporting
Language Featuresâ
- Syntax: New language constructs
- Standard Library: Core functionality
- Type System: Advanced type features
- Memory Management: Ownership and borrowing
Documentationâ
- Language Guide: Tutorial content
- API Documentation: Function and type docs
- Examples: Code samples and tutorials
- Architecture: Compiler internals
Toolingâ
- IDE Support: Language server protocol
- Debugger: Debugging tools
- Profiler: Performance analysis
- Package Manager: Dependency management
Development Workflowâ
Making Changesâ
- Create a feature branch:
git checkout -b feature/your-feature-name
- Make your changes
- Write tests for new functionality
- Ensure all tests pass:
cargo test
- Format your code:
cargo fmt
- Run the linter:
cargo clippy
Submitting Changesâ
- Commit your changes:
git add .
git commit -m "Add feature: brief description"
- Push to your fork:
git push origin feature/your-feature-name
- Create a Pull Request on GitHub
Code Styleâ
Rust Codeâ
Follow Rust's standard formatting and conventions:
// Use snake_case for variables and functions
let user_name = "Alice";
// Use PascalCase for types
struct UserProfile {
name: String,
email: String,
}
// Use SCREAMING_SNAKE_CASE for constants
const MAX_RETRY_COUNT: u32 = 3;
Rive Codeâ
Follow Rive's coding conventions:
// Use snake_case for variables and functions
let user_name = "Alice";
fun calculate_total_price() -> Float {
// ...
}
// Use PascalCase for types
struct UserProfile {
name: String,
email: String,
}
Testingâ
Writing Testsâ
Add tests for new functionality:
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_new_feature() {
// Test implementation
assert_eq!(expected, actual);
}
}
Test Categoriesâ
- Unit Tests: Individual function testing
- Integration Tests: Component interaction testing
- Compiler Tests: End-to-end compilation testing
- Performance Tests: Benchmarking
Documentationâ
Code Documentationâ
Document public APIs:
/// Calculates the area of a rectangle.
///
/// # Arguments
/// * `width` - The width of the rectangle
/// * `height` - The height of the rectangle
///
/// # Returns
/// The area as a floating-point number.
pub fn calculate_area(width: f64, height: f64) -> f64 {
width * height
}
Language Documentationâ
When adding new language features:
- Update the language reference
- Add examples to the tutorial
- Update the grammar specification
- Add error message documentation
Issue Reportingâ
Bug Reportsâ
When reporting bugs, include:
- Rive version
- Operating system
- Steps to reproduce
- Expected behavior
- Actual behavior
- Error messages (if any)
Feature Requestsâ
When requesting features:
- Clear description of the feature
- Use cases and motivation
- Proposed syntax (if applicable)
- Implementation considerations
Community Guidelinesâ
Code of Conductâ
- Be respectful and inclusive
- Welcome newcomers
- Provide constructive feedback
- Help others learn and grow
Communication Channelsâ
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: General discussion and questions
- Pull Requests: Code reviews and feedback
Recognitionâ
Contributors are recognized in:
- CONTRIBUTORS.md: List of all contributors
- Release Notes: Major contributions highlighted
- Documentation: Credit for significant contributions
Getting Helpâ
If you need help:
- Check existing issues and discussions
- Ask questions in GitHub Discussions
- Join the community chat (if available)
- Reach out to maintainers
Thank you for contributing to Rive! đ