This is very simple Bash & Python scripting which can be used to speed up code reviews. It is very useful for reviewing code in a bigger teams while the amount of code to review is huge. Do not expect spectacular results, but it can help you to save some time.
Script is looking at the diff of your changes and then it is using OpenAI API to generate a summary of the changes, suggestions, and improvements. Each file is processed separately and the results are saved in separate files each.
Make sure to set your OpenAI API key as an environment variable so it can be consumed by the script.
$ export OPENAI_API_KEY=<your_openai_api_key>
$ ./code_review.sh origin/main origin/my_feature_branch
Script is assuming that your remote git repo is called
origin
.
- Thanks to OpenAI for providing such a great API.
- Thanks to Git for providing such a great tool.
- Thanks to Bash for providing such a great scripting language.
- Thanks to Python for providing such a great scripting language.
Best regards, Michal :)