"""Roast templates for fallback mode."""

ROAST_TEMPLATES = {
    "tiny_commit": [
        "🔥 A one-liner? What is this, a commit for ants? At least it's not breaking anything... probably. 😅",
        "😏 One line changed. Did you forget to save the rest of your work, or is this your idea of 'moving fast'?",
        "🤏 Congratulations on the microscopic commit! Every journey begins with a single step... but maybe take a few more? 💨",
    ],
    
    "poor_message": [
        "🙄 'fixed stuff' - ah yes, the ancient art of commit message poetry. Shakespeare would be proud... NOT! Try being specific next time. 📝",
        "😬 That commit message though... Did you fall asleep on the keyboard? Give future you some context! 🤔",
        "🎭 'WIP' - Working In Progress? More like 'Why Is Perfection' so hard to achieve! Clean up that message! ✨",
        "💀 Your commit message has less detail than a tweet. And that's saying something. Be descriptive! 📖",
    ],
    
    "massive_commit": [
        "🚨 WOAH THERE! 500+ lines changed? That's not a commit, that's a novel! Break it up next time, champ. 📚",
        "😱 This commit is MASSIVE! Did you just push your entire life's work? Smaller commits = easier debugging! 🔍",
        "🎪 Welcome to the three-ring circus of commits! This one's doing WAY too much. Simplify, friend! 🎯",
        "🌋 Your commit is erupting with changes! Cool feature, but try atomic commits next time. ⚛️",
    ],
    
    "many_files": [
        "🤯 You touched how many files?! Someone's been busy... or refactoring everything. Hope you tested it all! ✅",
        "📂 Filing cabinet explosion detected! That's a lot of files for one commit. Everything still work? 🤞",
        "🌪️ Tornado commit alert! You swept through the codebase like nobody's business. Bold move! 💪",
    ],
    
    "no_tests": [
        "🧪 No test files in sight... Living dangerously, I see! Your code might work... until it doesn't. 🎲",
        "⚠️ Tests? Where we're going, we don't need tests! (Narrator: They definitely needed tests.) 🚀",
        "🎰 Pushing without tests is like gambling at a casino. Feeling lucky? Add some tests! 🍀",
    ],
    
    "good_commit": [
        "✅ Now THIS is a commit! Clean message, reasonable size, proper focus. You're getting the hang of it! 🎯",
        "👏 Not bad! This commit actually makes sense. Keep up this energy! 💯",
        "😌 A solid commit! Clear, focused, and well-documented. This is the way! 🌟",
    ],
    
    "average_commit": [
        "🤷 Eh, it's... a commit. Not great, not terrible. Room for improvement but you're getting there! 📈",
        "😐 Middle-of-the-road commit vibes. Does the job, could use some polish. Keep pushing! 💪",
        "📊 This commit is like a 'C+' - passing, but you can do better! Level up that commit game! 🎮",
    ],
    
    "default": [
        "🔥 Another day, another commit! Keep the code flowing and the bugs fleeing! 🐛",
        "💻 Commit received! Your code contribution has been noted in the annals of history. Make it count! 📜",
        "🚀 Code committed! Now the real test: does it work in production? 🤔",
        "⚡ Commit logged! Remember: with great commits comes great responsibility! 🦸",
    ]
}


def get_roast_category(commit_data: dict) -> str:
    """Determine the roast category based on commit data."""
    lines_changed = commit_data.get("lines_added", 0) + commit_data.get("lines_deleted", 0)
    files_changed = commit_data.get("files_changed", 0)
    is_clean = commit_data.get("is_clean", False)
    
    # Check for poor commit message first
    if not is_clean:
        return "poor_message"
    
    # Check for tiny commits
    if lines_changed < 5:
        return "tiny_commit"
    
    # Check for massive commits
    if lines_changed > 500:
        return "massive_commit"
    
    # Check for many files changed
    if files_changed > 15:
        return "many_files"
    
    # Check commit quality
    if is_clean and lines_changed < 200 and files_changed <= 5:
        return "good_commit"
    
    # Average commit
    if lines_changed < 200:
        return "average_commit"
    
    return "default"
