Skip to content

Latest commit

 

History

History
139 lines (100 loc) · 3.84 KB

File metadata and controls

139 lines (100 loc) · 3.84 KB

Contributing to Open Payments Rust

Thank you for your interest in contributing to the Open Payments Rust client library! This document provides guidelines and information for contributors.

Code of Conduct

This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.

How Can I Contribute?

Reporting Bugs

  • Use the GitHub issue tracker
  • Use the bug report template
  • Include detailed steps to reproduce the bug
  • Provide your environment details (OS, Rust version, etc.)
  • Include any error messages or logs

Suggesting Enhancements

Pull Requests

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass (cargo test)
  6. Run clippy (cargo clippy --all-targets --all-features -- -D warnings)
  7. Format your code (cargo fmt --all)
  8. Commit your changes (git commit -m 'Add amazing feature')
  9. Push to the branch (git push origin feature/amazing-feature)
  10. Open a Pull Request using the PR template

Development Setup

Prerequisites

  • Rust 1.43.1 or later
  • Git

Building

git clone https://github.com/interledger/open-payments-rust.git
cd open-payments-rust
cargo build

Testing

# Run all tests
cargo test

# Run tests with snippets feature
cargo test --features snippets

# Run doc tests
cargo test --doc

# Run clippy
cargo clippy --all-targets --all-features -- -D warnings

# Check formatting
cargo fmt --all -- --check

Documentation

# Generate documentation
cargo doc --no-deps

# Generate documentation with snippets
cargo doc --features snippets --no-deps

# Open documentation in browser
cargo doc --no-deps --open

Code Style

  • Follow Rust conventions and idioms
  • Use cargo fmt to format code
  • Use cargo clippy to check for common issues
  • Write comprehensive tests
  • Add documentation for public APIs
  • Use meaningful variable and function names
  • Keep functions small and focused
  • Add doc comments for all public items

Testing Guidelines

  • Write unit tests for all new functionality
  • Ensure integration tests cover the main use cases
  • Test both success and error scenarios
  • Use descriptive test names
  • Mock external dependencies when appropriate

Documentation Guidelines

  • Add doc comments for all public APIs
  • Include usage examples in doc comments
  • Update README.md when adding new features
  • Keep documentation up to date with code changes

Commit Messages

  • Use clear, descriptive commit messages
  • Start with a verb in present tense
  • Keep the first line under 50 characters
  • Add more details in the body if needed
  • Reference issues when applicable

Release Process

  1. Update version in Cargo.toml
  2. Create a git tag
  3. Push the tag to trigger release workflow

Questions?

If you have questions about contributing, please:

Getting Help