Thank you for considering contributing to warcraft-rs. This document provides guidelines and instructions to make the contribution process smooth and effective for everyone.
- Code of Conduct
- Getting Started
- Making Contributions
- Coding Guidelines
- Documentation
- Community
- Recognition
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to me.
-
Fork the repository: Click the "Fork" button at the top right of the repository page.
-
Clone your fork:
git clone https://github.com/your-username/warcraft-rs.git cd warcraft-rs -
Set up the upstream remote:
git remote add upstream https://github.com/wowemulation-dev/warcraft-rs.git
-
Install Rust and dependencies:
- Install Rust if you haven't already
- Run
cargo buildto download dependencies and build the project
- Check the Issues tab for tasks labeled "good first issue" or "help wanted"
- The TODO.md file contains a list of planned features and improvements if you need help finding a suitable task
# Make sure you're up to date
git checkout main
git pull upstream main
# Create a new branch
git checkout -b my-feature-branchName your branch descriptively, e.g., add-blp-support or fix-header-reading.
- Code: Implement your changes following our Coding Guidelines
- Tests: Add or update tests for your changes
- Documentation: Update documentation as needed
Before submitting your changes, make sure to run:
# Format your code
cargo fmt
# Check for common issues
cargo clippy --all-targets --all-features
# Run tests
cargo test
# Check dependencies for security issues
cargo deny checkIf you've added a new feature, consider adding a benchmark:
cargo benchOur CI/CD pipeline automatically runs the following checks on all pull requests:
-
Quick Checks (runs first, fails fast):
- Code formatting (
cargo fmt) - Compilation check (
cargo check) - Linting (
cargo clippy)
- Code formatting (
-
Test Matrix:
- Runs on Linux, Windows, and macOS
- Tests with Rust stable, beta, and MSRV (1.86.0)
- Tests with all features and no default features
-
Documentation:
- Builds documentation with warnings as errors
- Checks for broken documentation links
-
Code Coverage:
- Measures test coverage with cargo-llvm-cov
- Reports to Codecov
-
Security Audits (runs on schedule):
- Dependency vulnerability scanning
- License compliance checks
-
Cross-Platform Builds:
- Builds for multiple targets including ARM64 and Windows
- Uses cross-compilation where needed
-
Benchmarks (on PRs):
- Compares performance against the base branch
- Automatically comments results on PRs
-
Release Pipeline:
- Automated releases on version tags
- Builds binaries for all supported platforms
- Publishes crates to crates.io
- Creates GitHub releases with artifacts
-
Push your changes:
git push origin my-feature-branch
-
Create a Pull Request: Go to the repository page and click "New Pull Request"
-
Describe your changes:
- Provide a clear title
- Explain what you've changed and why
- Reference any related issues (e.g., "Fixes #42")
- Include any special instructions for testing
-
Respond to feedback: Maintainers may suggest changes to your PR. Discuss and make any necessary updates.
- Follow Rust's official style guide
- Use meaningful variable and function names
- Write clear comments for complex logic
- Keep functions focused on a single responsibility
- Add proper error handling using
ResultandOptiontypes - Include unit tests for all new functionality
Good documentation is essential for our project:
- Code Comments: Document functions and complex logic
- Examples: Add examples for new features in the
examples/directory - README: Update the README if your changes add new features or change existing functionality
- Rustdoc: Add documentation comments (
///) to public API elements
We're building a friendly and inclusive community:
- Ask questions: If you're unsure about something, ask
- Help others: Share your knowledge by answering questions
- Be respectful: Always be kind and constructive in communications
We value all contributions, big and small! Contributors will be:
- Listed in our CONTRIBUTORS.md file
- Mentioned in release notes when their contributions are included
- Recognized in project documentation
New to open source or Rust? Here are some tips to get started:
- Fork: Creates your personal copy of the repository
- Clone: Downloads the repository to your computer
- Branch: Creates a separate workspace for your changes
- Commit: Saves your changes with a message explaining what you did
- Push: Uploads your changes to GitHub
- Pull Request: Asks the project maintainers to review and merge your changes
- Start small: Fix a typo, improve documentation, or tackle a "good first issue"
- Ask questions: Don't hesitate to ask for clarification or help
- Be patient: Maintainers are often busy; give them time to respond
- Stay positive: Be open to feedback and suggestions
Thank you for contributing to warcraft-rs! Your efforts help make this project
better for everyone. If you have any questions or need assistance, please reach
out to us in the Discord.