Skip to content

Freak29/empathetic-code-reviewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Empathetic Code Reviewer 🤖

Python Version Status License

A smart tool that transforms critical code feedback into constructive, educational guidance.

This project uses Generative AI to act as an ideal senior developer, fostering a healthier and more productive learning environment by making code reviews supportive instead of stressful.


✨ Core Features

  • 🧠 Contextual Awareness: Intelligently adapts its tone based on the feedback's severity—from a relaxed suggestion for a style issue to a more formal tone for performance concerns.
  • 📚 Resource Linking: Provides links to official documentation or style guides for deeper, self-paced learning.
  • ✍️ Empathetic Rephrasing: Rewrites blunt critiques in a positive and encouraging tone.
  • 🎓 Educational Explanations: Clearly explains the "why" behind each suggestion, referencing core software engineering principles.
  • ✅ Actionable Suggestions: Provides concrete, corrected code examples for each piece of feedback.
  • 👍 Holistic Summary: Generates a final, encouraging summary of all the feedback, leaving the developer on a positive note.

🛠️ Getting Started

Follow these steps to get the project running locally.

Prerequisites

  • Python 3.x installed on your system.
  • A Google Gemini API key.

Installation & Setup

  1. Clone the Repository

    git clone [Your Repository URL Here]
    cd [Your Repository Name]
  2. Install Dependencies

    pip install -r requirements.txt
  3. Configure API Key Open main.py and replace the placeholder with your Gemini API key:

    my_api_key = "YOUR_API_KEY_HERE"

▶️ How to Run

  1. Add Your Input: Edit the input.json file with the code snippet and review comments you want to analyze.

    {
      "code_snippet": "...",
      "review_comments": [
        { "comment": "...", "severity": "low" }
      ]
    }
  2. Execute the Script: Run the following command in your terminal:

    python main.py
  3. View the Output Report: The script will generate a review_report.md file containing the complete, AI-powered feedback.Check the Sample Report: A sample of the complete, AI-powered feedback has been generated and saved in the review_report.md file for your review..


📸 Screenshot

Here's a sample of the report generated by the Empathetic Code Reviewer:

Project Output Screenshot


About

A program that takes a snippet of code and a list of direct, critical review comments, and then uses Generative AI to rewrite them.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages