Skip to content

Latest commit

 

History

History
207 lines (157 loc) · 4.25 KB

File metadata and controls

207 lines (157 loc) · 4.25 KB

Contributing to Auto Clipper 🤝

Thank you for your interest in contributing to Auto Clipper! This document provides guidelines and information for contributors.

🚀 Getting Started

Prerequisites

  • Rust 1.75.0 or higher
  • FFmpeg
  • yt-dlp
  • curl
  • Git

Development Setup

  1. Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/clipper-rust.git
cd clipper-rust
  1. Set up environment
cp .env.example .env
# Add your Gemini API key to .env
  1. Install dependencies and build
cargo build
cargo test

📋 How to Contribute

🐛 Reporting Bugs

  1. Check if the bug has already been reported in Issues
  2. If not, create a new issue with:
    • Clear description of the bug
    • Steps to reproduce
    • Expected vs actual behavior
    • System information (OS, Rust version, etc.)
    • Error messages or logs

💡 Suggesting Features

  1. Check Issues for existing feature requests
  2. Create a new issue with:
    • Clear description of the feature
    • Use case and motivation
    • Possible implementation approach

🔧 Code Contributions

  1. Create a branch
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix
  1. Make your changes

    • Follow the coding standards below
    • Add tests for new functionality
    • Update documentation if needed
  2. Test your changes

cargo test
cargo clippy
cargo fmt
  1. Commit your changes
git add .
git commit -m "feat: add new feature" # or "fix: resolve bug"
  1. Push and create PR
git push origin your-branch-name

Then create a Pull Request on GitHub.

📝 Coding Standards

Rust Code Style

  • Use cargo fmt for formatting
  • Use cargo clippy for linting
  • Follow Rust naming conventions
  • Add documentation comments for public functions
  • Keep functions small and focused

Commit Messages

Follow Conventional Commits:

  • feat: new features
  • fix: bug fixes
  • docs: documentation changes
  • style: formatting changes
  • refactor: code refactoring
  • test: adding tests
  • chore: maintenance tasks

Code Examples

/// Analyzes video with Gemini AI to suggest viral clips
/// 
/// # Arguments
/// * `video_info` - Video title and metadata
/// * `duration` - Video duration in seconds
/// 
/// # Returns
/// * `Result<String, Box<dyn std::error::Error>>` - JSON response from Gemini
async fn analyze_with_gemini(
    video_info: &str, 
    duration: f64
) -> Result<String, Box<dyn std::error::Error>> {
    // Implementation
}

🧪 Testing

Running Tests

# Run all tests
cargo test

# Run specific test
cargo test test_name

# Run with output
cargo test -- --nocapture

Writing Tests

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_timestamp_parsing() {
        // Test implementation
    }

    #[tokio::test]
    async fn test_async_function() {
        // Async test implementation
    }
}

📚 Documentation

Code Documentation

  • Add rustdoc comments for public APIs
  • Include examples in documentation
  • Update README.md for user-facing changes

Documentation Structure

docs/
├── README.md           # Main documentation
├── installation.md     # Installation guide
├── usage.md           # Usage examples
├── configuration.md   # Configuration options
├── api.md            # API reference
└── development.md    # Development guide

🏷️ Release Process

  1. Update version in Cargo.toml
  2. Update CHANGELOG.md
  3. Create release PR
  4. Tag release after merge
  5. GitHub Actions will build and publish

💬 Community

📄 License

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

🙏 Recognition

Contributors will be recognized in:

  • README.md contributors section
  • Release notes
  • GitHub contributors page

Thank you for contributing to Auto Clipper! 🎉