flake8
-
reviewboard/reviews/ui/base.py (Diff revision 1) -
reviewboard/reviews/views/attachments.py (Diff revision 1) line too long (80 > 79 characters) Column: 80 Error code: E501
Review Request #13533 — Created Feb. 12, 2024 and submitted
When instantiating review UIs for attachments with diffs, we would
create two instances, and then callset_diff_against
and discard one
of them. We'd then reconstruct the second instance when rendering to set
thediffTypeMismatch
field in the JS model. This also had a bug where
if the two revisions did not match in file types, we'd still always
instantiate the review UI for the "modified" version, which would then
fail in various ways on the client side depending on which particular
ReviewUI was in charge.This change makes it so we find the ReviewUI classes for both the
original and modified files first, and compare them. If they match, we
can instantiate a single instance. If they don't, we instantiate a
generic review UI that just sets that the type doesn't match.On the frontend, the
DummyReviewableView
(used for any ReviewUI that
doesn't provide their own) has been fixed up and enhanced in a couple
ways. First, the way that captions were displayed was backwards (showing
the original file caption on the right). The caption table was also not
properly styled so everything jammed up on the left. Finally, I've also
added a new error message that shows up whendiffTypeMismatch
is set,
to tell the user that we can't show a diff.The particular styling rules for the
DummyReviewableView
are a little
ugly and just inserted into the reviews.less file. I plan to redo all
the styling for all the review UIs in a later change.
Summary | ID |
---|---|
7fd8745e5b4e20742ed5f85f091a45566f88c296 |
Description | From | Last Updated |
---|---|---|
'housekeeping.functions.deprecate_non_keyword_only_args' imported but unused Column: 1 Error code: F401 |
reviewbot | |
line too long (80 > 79 characters) Column: 80 Error code: E501 |
reviewbot | |
It looks like you didn't actually add this argument. |
maubin | |
Can we type this while here, so it's not interpreted as a literal False? |
chipx86 | |
Can we type this? |
chipx86 | |
Let's pull this.model out into a local variable. We do an attribute lookup 10 times in this function. |
chipx86 | |
Should the quotes just be around the captions? It feels like the revision information should be outside of that. Another … |
chipx86 |
reviewboard/reviews/ui/base.py (Diff revision 1) |
---|
reviewboard/reviews/views/attachments.py (Diff revision 1) |
---|
line too long (80 > 79 characters) Column: 80 Error code: E501
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+280 -76) |
reviewboard/reviews/ui/base.py (Diff revision 2) |
---|
It looks like you didn't actually add this argument.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+272 -76) |
reviewboard/reviews/ui/base.py (Diff revision 3) |
---|
Can we type this while here, so it's not interpreted as a literal
False
?
reviewboard/static/rb/js/reviews/views/dummyReviewableView.ts (Diff revision 3) |
---|
Let's pull
this.model
out into a local variable. We do an attribute lookup 10 times in this function.
reviewboard/static/rb/js/reviews/views/dummyReviewableView.ts (Diff revision 3) |
---|
Should the quotes just be around the captions? It feels like the revision information should be outside of that.
Another approach would be to mark up that information in bold or something, so it's more readily identifiable as something other than just text in this string.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+286 -86) |