Adding Comments to Code
Last modified: October 23, 2019
There are two comment types available: a general note on a review, and a code-specific comment. A general comment is used, for example, when a reviewer wants to indicate a recurring mistake/defect in the author’s code. Leaving a code-specific comment is handy when a reviewer comes across a single, not typical defect.
To add a general comment to the whole review:
-
Select a review.
-
Click Add General Comment.
-
Enter the comment text into the corresponding field.
-
Click Create.
Note:
All reviews and comments have their ID - a unique identifier that can be used when searching specific comment or review.
To add a comment to a specific line of the code:
-
Select a file from the list, double-click it to review. The file is opened in a new window.
-
Right-click a code line, and click Add Review Comment in the shortcut menu.
-
Enter the comment description.
-
Click Create.
To add a comment to a block of code:
-
Select a file from the list, double-click it to review. The file is opened in a new window.
-
Right-click a code block, and click Add Review Comment in the shortcut menu.
-
Enter the comment description.
-
Click Create.
To open the comment description, click the comment marker.
Adding a comment to a review with multiple authors:
There are two situations when multiple authors may be assigned to a review:
- When multiple revisions with different authors are added to the review, the authors are added automatically;
- When authors are added manually.
All authors have equal rights and may restart or close a review independently of each other.
Adding a comment to a multiple author review is similar to that described in the above topics. Comments are then automatically addressed to the author of a file revision commented upon.
When you add a comment in a multiple authors review, the Assignee box automatically fills up with the author of the file revision. To change the assignee, select one of the available authors from the drop-down list.