This project demonstrates a Proof of Concept (POC) that integrates with OpenAI to generate code review summaries for each file in a GitHub project, categorized by file extension.
The goal of this project is to automate the process of code reviews by querying OpenAI for insights and summaries on the code within each file of a given GitHub repository. The code is analyzed based on its file extension to provide relevant feedback tailored to the specific programming language or framework.
- GitHub Integration: Fetches project files from a GitHub repository.
- File Extension Categorization: The analysis is performed separately for each file type, with OpenAI generating relevant reviews based on the language and file extension.
- OpenAI Code Summarization: Uses OpenAI API to provide code review summaries, highlighting areas of improvement and potential bugs.
- A GitHub repository to analyze.
- An OpenAI API key for interacting with the OpenAI service.
-
Clone this repository to your local machine:
git clone https://github.com/cikavelja/Git_To_OpenAI.git
-
Open project in VisualStudio 2022:
-
Set up environment variables: OpenAI Key
-
How to video: YouTube
Modify the configuration file to specify your GitHub repository and any specific file extensions you'd like to focus on. The system will pull files from the repository, filter by the provided extensions, and send them to OpenAI for review.
-
Run the application to start querying OpenAI for code review summaries:
npm start
-
The application will fetch files from your GitHub project, analyze them, and print out the OpenAI-generated summaries for each file type.
For each file in the GitHub repository, the output might look like this:
File: src/main.py
Summary: This Python file contains a function that calculates the sum of an array. Consider adding type hints for better code readability.
File: src/utils.js
Summary: The JavaScript utility file is concise, but you might want to check for edge cases when handling input values.
Feel free to fork this project, submit issues, or open pull requests. Contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.