DEV Community

jkorichneva
jkorichneva

Posted on

Is your PR really ready for review?

When it comes to writing code, it's not just about making it work - it's also about making it readable and maintainable. Even though code review is a common practice, it is still a time-consuming and sometimes tiring process. It's important to reduce the amount of time needed for review and to make it easier for your colleagues. This way you have better chances for quick merge 🙂

One effective way to do this is by checking your own PRs before asking for a review. But what exactly should you be checking in order to save everyone's time?

While there are numerous articles and checklists on this topic, most of them cover common issues that can be fixed automatically, like alphabetical sorting of imports, typos and etc. Instead, this checklist focuses on aspects that cannot be automated:

  • Variable names are clear and descriptive.
  • Comments are added where necessary to clarify your changes.
  • There are no out-of-scope changes in the PR.
  • PR focuses on one feature and is relatively small.
  • All functions and variables are in the right files and that there are no misplaced elements.
  • There is a description of the PR to give reviewers context.
  • Docs are updated to reflect any changes made in the PR.
  • Any necessary cleanups are done.
  • Follow the single responsibility principle in functions.
  • Keep consistency in mind throughout the PR.
  • Follow the boyscout rule: 'Always leave the code better than you found it.'

If you check whether your PR complies with these rules, you will definitely get less comments on Code Review and save your colleagues a lot of time🙌

Top comments (0)