Please don't open a pull request without doing a self review first.
It might seem counterintuitive, but self-reviewing your code benefits both yourself and your team.
It helps you catch errors, bugs, or any issues that have slipped through. It also allows you to ensure that your code aligns with your company's code guidelines or standards.
So, submitting a self-reviewed PR increases your team's trust in you, leads to faster code reviews, opens the door to more meaningful discussions and teaches you to detach from your code and spot areas for improvement.
It's a win-win for everyone.
My only 2 tips for self-reviews are:
1) Take a longer break before doing it, so you come with a fresh perspective.
2) Detach yourself from the code. Be objective.
However, self-reviewing your code can feel like a chore. Thankfully, there is a solution to that.
@coderabbitai speeds up the process and makes it more engaging.
CodeRabbit is an AI tool that automatically reviews your pull requests, provides context-aware feedback, and suggests code changes.
How do I use it?
1. Find issues, errors, and bugs
As the 1st image shows, CodeRabbit highlighted an issue. It described what the issue is, and suggested a change.
2. Catch silly mistakes
As the 2nd image shows, it also catches silly mistakes.
I copied the error message from another component and forgot to adapt it accordingly. CodeRabbit understood the context and suggested the change.
3. Discover areas for improvements
As the 3rd image shows, it also suggests improvements for your code.
It gave an excellent suggestion that I had overlooked initially. It saved me some future headaches.
Conclusion?
It's a great and valuable tool that significantly improves the self-review process and your code subsequently.
@coderabbitai has a 7-day free trial for private repositories, and it's free for open-source projects. If you're sceptical about it, give it a try!
It's a handy tool to add to your toolbox.
Thanks to
@coderabbitai for sponsoring my post. I've been using them for a while now.
coderabbit.ai