As a software engineer, I know that I should check my code before commit. But I don’t like code review. It is a tedious and time-consuming process. Not to mention the project deadline is approaching.
And then I was thinking, ChatGPT is out there, helping human on tedious work. Hmm, maybe it can help me?
I decided to make use of ChatGPT for my code review, and I have found it to be quite helpful.
My problem on Code Review
- Time: Code review can be a time-consuming process, particularly for large or complex commit.
- Lack of Reviewer: A good reviewer need to have a deep understanding of the frameworks and libraries being used, as well as the context and requirements of the project, wich is difficult to find. Moreover, it is not possible to find a review when I am working on a solo project.
- Subjectivity: It can be difficult to ensure human reviewers do not have bias on the codebase.
How ChatGPT can help
I integrated ChatGPT with git hook, in a way that when I run: