A blurred GitHub pull request review on the background and the icon of the “add a suggestion” feature focused in the foreground.

Add a suggestion in a GitHub pull request review

When you are reviewing a pull request on GitHub, you can add comments to one or multiple lines at a time, but you can also leave a direct suggestion that makes it extremely convenient for the other person to make the change that you want to see implemented.

When leaving a comment in a line of code, just look for the icon that looks like a page with a plus sign on top of a minus sign. If you click that icon, GitHub will insert the content of the line(s) of code that is highlighted inside triple backticks. Then, just edit that however you like. Whatever changes you make there will be shown as a “suggested edit” that the other party can accept with a click of a button.

Below, you can find a little animatied GIF showing how this works:

  1. highlight the lines of code where you want to suggest an edit;
  2. press the “add a suggestion” icon; and
  3. make your edits directly in the comment.
Animated example of how to add a suggestion on a GitHub pull request review.
Animated example of how to add a suggestion on a GitHub pull request review.

That's it for now! Stay tuned and I'll see you around!

Improve your Python 🐍 fluency and algorithm knowledge 🎯

Get ready for 12 intense days of problem-solving. The “Algorithm Mastery Bootcamp” starts December 1st and it will feature 24 programming challenges, live analysis sessions, a supportive community of like-minded problem-solvers, and more! Join now and become the Python expert others can rely on.

Previous Post Next Post

Blog Comments powered by Disqus.