Thank you for your interest in contributing to Xtreme Engine! This document provides guidelines for contributions.
- Check if the bug has already been reported in Issues
- If not found, create a new issue with:
- Clear and descriptive title
- Steps to reproduce the problem
- Expected behavior vs actual behavior
- Rust version and operating system
- Error logs (if applicable)
- Open an issue with the
enhancementtag - Describe the feature in detail
- Explain why it would be useful for the project
- If possible, include usage examples
- Fork the repository
- Create a branch for your feature:
git checkout -b feature/my-feature
- Make your changes following the code style
- Write or update tests
- Ensure all tests pass:
cargo test --lib cargo clippy cargo fmt --check - Commit your changes:
git commit -m "feat: feature description" - Push to your branch:
git push origin feature/my-feature
- Open a Pull Request
- Use
cargo fmtfor formatting - Use
cargo clippyfor linting - Follow the Rust API Guidelines
We use Conventional Commits:
| Prefix | Description |
|---|---|
feat: |
New feature |
fix: |
Bug fix |
docs: |
Documentation |
style: |
Formatting (no code change) |
refactor: |
Refactoring |
test: |
Adding/fixing tests |
chore: |
General maintenance |
- Keep files between 300-500 lines
- One module = one responsibility
- Prefer composition over inheritance
- Document public APIs with
///
src/core/
├── entity.rs # Entity management
├── component.rs # Component storage
├── world.rs # Main container
├── query.rs # Query system
└── system.rs # Scheduler
- Modularity - Each module should be independent
- Zero-cost abstractions - Performance and ergonomics
- Data-oriented design - Contiguous data in memory
- Isolation - Easy to maintain and test
# Unit tests
cargo test --lib
# Tests with output
cargo test --lib -- --nocapture
# Specific test
cargo test --lib test_name#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_descriptive_name() {
// Arrange
let input = ...;
// Act
let result = function(input);
// Assert
assert_eq!(result, expected);
}
}- Document all public APIs
- Include code examples when useful
- Update the README if necessary
/// Brief description of the function.
///
/// # Arguments
///
/// * `param` - Parameter description
///
/// # Returns
///
/// Return description
///
/// # Examples
///
/// ```
/// let result = my_function(42);
/// assert_eq!(result, 84);
/// ```
pub fn my_function(param: i32) -> i32 {
param * 2
}- At least 1 approval required
- CI must pass (tests, clippy, fmt)
- No conflicts with main branch
- Documentation updated
- Be respectful and inclusive
- Accept constructive criticism
- Focus on what is best for the project
- Show empathy towards other contributors
Open an issue with the question tag or contact the maintainers.
Thank you for contributing!