Remove leading and trailing blank lines in review comments.
Review Request #4561 — Created Sept. 12, 2013 and submitted
Remove leading and trailing blank lines in review comments.
When a user submits a review comment, leading and trailing
blank lines are saved as part of the comment. We want to strip
these blank lines before saving the comment to the database.Reviewed at https://reviews.reviewboard.org/r/4561/
Fix for issue 2933
Created new review request and manually tested:
-review
-review reply
-diff comment
-reply diff comment
-file attachment comment
-reply file attachment commentUnit tests pass.
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
reviewboard/reviews/templatetags/reviewtags.py
Ignored Files:
- Change Summary:
-
Added to students review group
- Groups:
-
Great to see the first UCOSP review request for the term, congratulations!
I feel like this would be better handled by actually stripping the whitespace
before the comment is saved to the database. That way we don't have this extra
whitespace hanging around, especially since the comment will be rendered in
multiple places, such as when review board sends out notification emails.Also, you should fill out the "Testing Done" section on your review requests
to tell us what you tested, and how you tested it.Really happy to see you getting started! :D
- Change Summary:
-
Trim whitespace before saving the comment to the database instead of trimming when rendering.
- Description:
-
Remove leading and trailing blank lines in review comments.
When a user submits a review comment, leading and trailing
blank lines are saved as part of the comment. We want to strip ~ these blank lines when rendering. ~ these blank lines before saving the comment to the database. - Testing Done:
-
+ Created new review request and new review for it.
+ + Added several comments with leading blank lines only, trailing
+ blank lines only, and both. + + Comments saved with leading and trailing blank lines removed.
+ + Unit tests pass.
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
Ignored Files:
reviewboard/static/rb/js/views/reviewReplyEditorView.js
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
Ignored Files:
reviewboard/static/rb/js/views/reviewReplyEditorView.js
-
This looks like it will work for replies to reviews, but not for the initial comments on any given line. We probably want a similar change in commentDialogView.js
- Change Summary:
-
Remove extra whitespace in initial comments.
- Summary:
-
Remove leading and trailing blank lines in review comments.[WIP] Remove leading and trailing blank lines in review comments.
- Change Summary:
-
Handle whitespace trimming in the Web API level instead of the JS level.
- Description:
-
Remove leading and trailing blank lines in review comments.
When a user submits a review comment, leading and trailing
blank lines are saved as part of the comment. We want to strip these blank lines before saving the comment to the database. + + Reviewed at https://reviews.reviewboard.org/r/4561/
+ Fix for issue 2933 - Diff:
-
Revision 4 (+9 -7)
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/webapi/resources/review_reply_file_attachment_comment.py
reviewboard/webapi/resources/review_file_attachment_comment.py
reviewboard/webapi/resources/review_screenshot_comment.py
reviewboard/webapi/resources/base_review.py
reviewboard/webapi/resources/review_reply_diff_comment.py
reviewboard/webapi/resources/review_reply_screenshot_comment.py
reviewboard/webapi/resources/review_diff_comment.py
reviewboard/webapi/resources/review_reply.py
Ignored Files: -
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
reviewboard/webapi/resources/review_reply_file_attachment_comment.py
reviewboard/webapi/resources/review_file_attachment_comment.py
reviewboard/webapi/resources/review_screenshot_comment.py
reviewboard/webapi/resources/base_review.py
reviewboard/webapi/resources/review_reply_diff_comment.py
reviewboard/webapi/resources/review_reply_screenshot_comment.py
reviewboard/webapi/resources/review_diff_comment.py
reviewboard/webapi/resources/review_reply.py
Ignored Files:
- Change Summary:
-
Fix wrapping.
- Diff:
-
Revision 5 (+10 -7)
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/webapi/resources/review_reply_file_attachment_comment.py
reviewboard/webapi/resources/review_file_attachment_comment.py
reviewboard/webapi/resources/review_screenshot_comment.py
reviewboard/webapi/resources/base_review.py
reviewboard/webapi/resources/review_reply_diff_comment.py
reviewboard/webapi/resources/review_reply_screenshot_comment.py
reviewboard/webapi/resources/review_diff_comment.py
reviewboard/webapi/resources/review_reply.py
Ignored Files:
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
reviewboard/webapi/resources/review_reply_file_attachment_comment.py
reviewboard/webapi/resources/review_file_attachment_comment.py
reviewboard/webapi/resources/review_screenshot_comment.py
reviewboard/webapi/resources/base_review.py
reviewboard/webapi/resources/review_reply_diff_comment.py
reviewboard/webapi/resources/review_reply_screenshot_comment.py
reviewboard/webapi/resources/review_diff_comment.py
reviewboard/webapi/resources/review_reply.py
Ignored Files:
- Summary:
-
[WIP] Remove leading and trailing blank lines in review comments.Remove leading and trailing blank lines in review comments.
- Testing Done:
-
~ Created new review request and new review for it.
~ Created new review request and manually tested:
~ Added several comments with leading blank lines only, trailing
~ blank lines only, and both. ~ ~ Comments saved with leading and trailing blank lines removed.
~ -review
~ -review reply ~ -diff comment ~ -reply diff comment + -file attachment comment + -reply file attachment comment Unit tests pass.
- Bugs:
- Change Summary:
-
Fix spacing.
- Diff:
-
Revision 6 (+11 -7)
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/webapi/resources/review_reply_file_attachment_comment.py
reviewboard/webapi/resources/review_file_attachment_comment.py
reviewboard/webapi/resources/review_screenshot_comment.py
reviewboard/webapi/resources/base_review.py
reviewboard/webapi/resources/review_reply_diff_comment.py
reviewboard/webapi/resources/review_reply_screenshot_comment.py
reviewboard/webapi/resources/review_diff_comment.py
reviewboard/webapi/resources/review_reply.py
Ignored Files:
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
reviewboard/webapi/resources/review_reply_file_attachment_comment.py
reviewboard/webapi/resources/review_file_attachment_comment.py
reviewboard/webapi/resources/review_screenshot_comment.py
reviewboard/webapi/resources/base_review.py
reviewboard/webapi/resources/review_reply_diff_comment.py
reviewboard/webapi/resources/review_reply_screenshot_comment.py
reviewboard/webapi/resources/review_diff_comment.py
reviewboard/webapi/resources/review_reply.py
Ignored Files: