Thank you for your interest in contributing! This document provides guidelines for contributing to the project.
We follow a strict PR-based workflow. All changes go through:
- Feature branch from
main - Full check pipeline (format, tests, clippy, build)
- Pull request with CI checks
- Code review
- Merge only when green
# Clone repository
git clone https://github.com/bug-ops/helix-trainer.git
cd helix-trainer
# Create feature branch
git checkout -b feature/amazing-featureImportant
All PRs must pass these checks. CI enforces them automatically with zero tolerance for warnings.
Always run before pushing:
# 1. Format (requires nightly)
cargo +nightly fmt
# 2. Tests (fast parallel runner)
cargo nextest run
# 3. Lints (zero warnings policy)
cargo clippy --all-targets --all-features -- -D warnings
# 4. Build verification
cargo build --releaseTip
With sccache configured, rebuilds are 5x faster (~10s vs ~54s).
We use Conventional Commits:
| Prefix | Purpose | Example |
|---|---|---|
feat: |
New feature | feat: add streak multiplier |
fix: |
Bug fix | fix: correct XP calculation |
docs: |
Documentation | docs: update installation guide |
refactor: |
Code refactoring | refactor: simplify command handler |
test: |
Add/update tests | test: add fsrs scheduler tests |
chore: |
Maintenance | chore: update dependencies |
ci: |
CI/CD changes | ci: add ARM64 builds |
- Ensure all checks pass locally
- Update documentation if needed
- Add tests for new functionality
- Write a clear PR description
- Link related issues
- Wait for CI to pass
- Request review
- Follow idiomatic Rust patterns
- Use
rustfmtwith nightly (enforced by CI) - Keep functions focused and small
- Prefer explicit error handling over
.unwrap() - Add doc comments for public APIs
Caution
No unsafe code without explicit justification and approval.
Scenarios are defined in scenarios/en/*.toml. Each scenario must have:
[[scenarios]]
id = "unique_id"
name = "Human readable name"
description = "Clear description of what to achieve"
[scenarios.setup]
file_content = "initial text"
cursor_position = [0, 0]
[scenarios.target]
file_content = "expected result"
cursor_position = [0, 0]
[scenarios.solution]
commands = ["command", "sequence"]
[scenarios.metadata]
category = "Movement" # Movement, Editing, Clipboard, Selection, Search, Advanced
difficulty = "Beginner" # Beginner, Intermediate, Advanced
tags = ["relevant", "tags"]
commands_taught = ["w", "e"]Run cargo nextest run scenario to validate all scenarios.
- Unit tests:
cargo nextest run - Specific test:
cargo nextest run test_name - With coverage:
cargo llvm-cov
- Open an issue for bugs or feature requests
- Check existing issues before creating new ones
- Use discussion threads for questions
By contributing, you agree that your contributions will be licensed under the MIT License.