Contributing
Thank you for your interest in contributing to oops! We welcome contributions of all kinds.
Ways to Contribute
- Report bugs — Found a bug? Open an issue
- Add rules — Create new correction rules
- Improve docs — Fix typos, clarify explanations
- Write tests — Increase test coverage
- Fix issues — Tackle open issues on GitHub
Getting Started
Prerequisites
- Rust 1.88 or newer
- Git
Setup
# Clone the repository
git clone https://github.com/animeshkundu/oops.git
cd oops
# Build
cargo build
# Run tests
cargo test
# Run lints
cargo clippy -- -D warnings
# Format code
cargo fmt
Code Style
General Guidelines
- Follow existing code patterns
- Use
cargo fmtbefore committing - Ensure
cargo clippypasses with no warnings - Add tests for new functionality
- Document public APIs
Rust Conventions
- Use
&stroverStringin function parameters - Use
Result<T>withanyhowfor error handling - Add
#[derive(Debug, Clone)]to structs - Use
tracingmacros for logging
Pull Requests
Before Submitting
- Tests pass:
cargo test - No lint warnings:
cargo clippy -- -D warnings - Formatted:
cargo fmt --check - Builds cleanly:
cargo build
PR Description
Include in your PR:
- Description of changes
- Why the changes are needed
- Any breaking changes
- Test results
Reporting Bugs
When filing a bug report, include:
- oops version (
oops --version) - Operating system and version
- Shell being used
- Steps to reproduce
- Expected behavior
- Actual behavior
- Debug output if applicable (
oops --debug)
Feature Requests
We welcome feature requests! Please:
- Check existing issues first
- Describe the use case clearly
- Explain why existing features don't work
- Consider submitting a PR if you can implement it
Project Structure
src/
├── main.rs # Entry point, CLI dispatch
├── cli.rs # Argument parsing (clap)
├── config/ # Settings and config file loading
├── core/ # Command, Rule trait, Corrector engine
├── rules/ # 177+ correction rules
│ ├── git/ # Git-related rules
│ ├── package_managers/ # Package manager rules
│ └── ...
├── shells/ # Shell integrations (bash, zsh, etc.)
├── output/ # Command execution
├── ui/ # Terminal UI, colors
└── utils/ # Caching, fuzzy matching
Adding Rules
Adding new correction rules is one of the most valuable contributions! See the Creating Rules guide for detailed instructions.
Code of Conduct
Please be respectful and inclusive. We aim to maintain a welcoming environment for all contributors.
Getting Help
- GitHub Discussions — Ask questions
- GitHub Issues — Report bugs