mock_commit/
mock_commit.rs

1/// Mock commit example for testing purposes
2/// 
3/// This example shows how to create mock commits for testing
4/// without actually making API calls
5/// 
6/// Run with: cargo run --example mock_commit
7
8use noob_commit::Commit;
9
10fn main() {
11    // Example commit messages for different scenarios
12    let commit_examples = vec![
13        Commit::new(
14            "feat: add user authentication system".to_string(),
15            "Implemented OAuth2 authentication with support for Google and GitHub providers. Added JWT token generation and validation for secure session management.".to_string(),
16        ),
17        Commit::new(
18            "fix: resolve memory leak in cache handler".to_string(),
19            "Fixed memory leak caused by unreleased references in the LRU cache implementation. Added proper cleanup in the destructor and improved memory management.".to_string(),
20        ),
21        Commit::new(
22            "docs: update API documentation with new endpoints".to_string(),
23            "Added comprehensive documentation for the new REST API endpoints including request/response examples, authentication requirements, and error codes.".to_string(),
24        ),
25        Commit::new(
26            "refactor: improve error handling in database module".to_string(),
27            "Refactored database error handling to use Result types consistently. Added custom error types for better error propagation and debugging.".to_string(),
28        ),
29        Commit::new(
30            "test: add unit tests for payment processing".to_string(),
31            "Added comprehensive unit tests for payment processing module covering edge cases, error scenarios, and successful payment flows.".to_string(),
32        ),
33    ];
34
35    println!("Example commit messages:");
36    println!("========================");
37    
38    for (i, commit) in commit_examples.iter().enumerate() {
39        println!("\n{}. Title: {}", i + 1, commit.title);
40        println!("   Description: {}", commit.description);
41    }
42    
43    println!("\nThese are examples of well-formatted commit messages that follow conventional commit standards.");
44    println!("When using noob-commit, the AI will generate similar messages based on your staged changes.");
45}