Git & GitHub
/Beginner
Review Comments
Definition
Specific annotations made by reviewers on individual lines of code within a Pull Request.
Explain Like I'm New
Instead of leaving a generic comment at the bottom of the page saying 'Fix the spelling on line 42', you hover your mouse over line 42, click the '+' button, and leave a comment directly attached to that specific line of code.
Real World Example
Leaving a 'Suggested Change' comment. GitHub allows you to literally type out the fixed code in the comment box, and the author can click one button to instantly apply your fix without even opening their code editor.
Common Use Cases
- •Providing granular feedback on code
Terminal Output
bash / terminal
/*
Using GitHub's 'Suggested Change' feature in a comment:
```suggestion
const userName = user.firstName + ' ' + user.lastName;
```
When you leave a comment formatted like this, GitHub renders it as a
Diff block with an "Commit Suggestion" button. The PR author can click
that button to instantly fix their code right from the web browser!
*/
Interview Questions
basic
- What does LGTM mean in a code review?
intermediate
- What is a 'Review' vs a 'Single Comment' on GitHub?