Skip to content

Latest commit

 

History

History
109 lines (75 loc) · 2.57 KB

File metadata and controls

109 lines (75 loc) · 2.57 KB

Contributing to RustyClaw

Thanks for your interest in contributing to RustyClaw! 🦀🦞

Getting Started

  1. Fork the repository
  2. Clone your fork: git clone https://github.com/YOUR_USERNAME/RustyClaw.git
  3. Create a branch: git checkout -b my-feature
  4. Make your changes
  5. Run tests: cargo test
  6. Commit: git commit -m "feat: add cool feature"
  7. Push: git push origin my-feature
  8. Open a Pull Request

Development Setup

Prerequisites

  • Rust 1.85+ (edition 2024)
  • Cargo

Build

cargo build

Test

# All tests
cargo test

# Specific test file
cargo test --test tool_execution

# With output
cargo test -- --nocapture

Lint

cargo clippy
cargo fmt --check

Pre-PR Checklist

Before opening a PR, ensure your changes compile without warnings:

# Check library builds warning-free
cargo check --all-features 2>&1 | grep -E "warning:" && echo "Fix warnings before submitting" || echo "✓ No warnings"

# Check tests compile warning-free
cargo test --no-run 2>&1 | grep -E "warning:" && echo "Fix test warnings before submitting" || echo "✓ No test warnings"

No PR should be considered finished while warnings are still present. Warnings slow down compilation, make CI noisier, and often indicate real issues.

Code Style

  • Follow Rust conventions (rustfmt enforced)
  • Use /// doc comments for public items
  • Add tests for new functionality
  • Keep functions focused and small

Commit Messages

We use Conventional Commits:

  • feat: New features
  • fix: Bug fixes
  • docs: Documentation only
  • test: Adding/updating tests
  • refactor: Code changes that don't add features or fix bugs
  • chore: Maintenance tasks

Adding Tools

  1. Add tool definition to all_tools() in src/tools.rs
  2. Create *_params() function for parameters
  3. Create exec_*() function for execution
  4. Add to resolve_params() match
  5. Add integration tests in tests/tool_execution.rs
  6. Update documentation

Adding Tests

  • Unit tests go in the module (#[cfg(test)] mod tests)
  • Integration tests go in tests/
  • Golden files in tests/golden/ (update with UPDATE_GOLDEN=1 cargo test)

Security

  • Never log secrets
  • Use the sandbox for command execution
  • Report security issues privately (see SECURITY.md)

Questions?

License

By contributing, you agree that your contributions will be licensed under the MIT License.