[WIP] Add ability to embed per file diffs on external sites

Review Request #7890 — Created Jan. 17, 2016 and discarded

Information

Review Board
master

Reviewers

Currently, Review Board's diffs can only be viewed within Review
Board. Sometimes, however, it would be nice to take a diff and
show it on another webpage, muchlike you can with GitHub's Gists
service, or a YouTube video.

This change creates an endpoint for the individual FileDiffs
from the DiffViewer for an iframe to point to. E.g.:

reviews.reviewboard.org/r/(review_request_id)/diff/(revision)/embed/(filediff_id)/

When this endpoint is hit, the necessary files to display a single
Diff fragment are returned as if it were extracted from the DiffViewer.

This change also includes a chain link icon beside the filename
in the diff viewer which, when clicked, shows a box with
pre-filled input fields which will hold embed and permalinks to
that file diff.

The full URL is generated and placed in the diff viewer dropdown box
Previously, the path was only included and now the full URL, with
the HTTP host, is included.

A new template has been created to display a diff fragment instead
of using the diff fragment template from the diff viewer. This will
save on loading more static files than necessary for the embedded
diff fragment and provides more control.

The proper styles have been applied to the diff fragment embed so
the embedded diff now looks presentable and in-line with the RB
theme.

The original diff fragment view and the diff fragment embed view
shared a lot of the same code. Similar code between these two
class based views were extracted into a parent class.

A link was also added to the embedded diff fragment that easily
allows a user to view the full diff on review board.

  • Tested URI in browser with no ill side effects.
  • Embed box needs to be fixed in Safari. Timeout is too fast.

Description From Last Updated

Can we maybe add some cute link back to the main diff that says something like "View this change on …

daviddavid

These fonts seem... large.

daviddavid

Col: 1 E302 expected 2 blank lines, found 1

reviewbotreviewbot

Col: 80 E501 line too long (82 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (101 > 79 characters)

reviewbotreviewbot

Col: 1 E302 expected 2 blank lines, found 1

reviewbotreviewbot

Col: 28 W291 trailing whitespace

reviewbotreviewbot

Col: 30 W291 trailing whitespace

reviewbotreviewbot

Can you format this so that each parameter is not on its own line?

brenniebrennie

Function-based views are on their way out, and we should probably not write new ones. Can we make this a …

daviddavid

Docstrings should be of the form: """Single line summary. Multi-line description. """ This is also missing an Args and Returns …

brenniebrennie

We use the imperitive mood for doc strings and doc comment, so this should read as: "Initialize the file diff …

brenniebrennie

We use the imperitive mood for doc strings and doc comment, so this should read as: "Initialize the file diff …

brenniebrennie

We can dispense with the whole router thing since users won't be able to change what revision they're looking at. …

daviddavid

"Remove"

brenniebrennie

"Render"

brenniebrennie

render() should return this;.

brenniebrennie

Put constants at the beginning

brenniebrennie

This doesn't do anything.

brenniebrennie

Col: 60 W291 trailing whitespace

reviewbotreviewbot

'DiffViewerView' imported but unused

reviewbotreviewbot

Col: 1 E302 expected 2 blank lines, found 1

reviewbotreviewbot

Col: 80 E501 line too long (87 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (80 > 79 characters)

reviewbotreviewbot

Col: 1 W293 blank line contains whitespace

reviewbotreviewbot

Col: 5 E303 too many blank lines (2)

reviewbotreviewbot

Col: 1 W293 blank line contains whitespace

reviewbotreviewbot

Col: 9 E122 continuation line missing indentation or outdented

reviewbotreviewbot

Col: 13 E122 continuation line missing indentation or outdented

reviewbotreviewbot

Col: 20 E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

Col: 19 E702 multiple statements on one line (semicolon)

reviewbotreviewbot

local variable 'diffset' is assigned to but never used

reviewbotreviewbot

Col: 9 E122 continuation line missing indentation or outdented

reviewbotreviewbot

Col: 19 E702 multiple statements on one line (semicolon)

reviewbotreviewbot

'build_server_url' imported but unused

reviewbotreviewbot

These should all be sorted in alphabetical order.

daviddavid

Undo this line deletion.

daviddavid

Undo this line addition.

daviddavid

This seems to share a lot with DiffFragmentView. Can we create some intermediate parent class for both that includes the …

daviddavid

If there's no docstring, the first line can be immediately after the class ... line. But maybe it's better to …

daviddavid

No blank line here (and/or add a docstring).

daviddavid

Can we log the exception as well?

daviddavid

Can we log the exception as well?

daviddavid

No blank line and/or add a docstring.

daviddavid

I know this is just copy/pasted, but we're trying to move towards using the imperative mood for docstrings as per …

daviddavid

Mind adding "Args:" and "Returns:" sections as per https://www.reviewboard.org/docs/codebase/dev/ ?

daviddavid

Mind adding "Args:" and "Returns:" sections as per https://www.reviewboard.org/docs/codebase/dev/ ?

daviddavid

Should be "Fetch ..."

daviddavid

Mind adding "Args:" and "Returns:" sections as per https://www.reviewboard.org/docs/codebase/dev/ ?

daviddavid

No blank line and/or docstring.

daviddavid

No blank line here.

daviddavid

No blank line here, docstring.

daviddavid

Can you put this on the previous line? name="diff-fragment-view"),

daviddavid

Should go on the previous line.

daviddavid

Please put this line back.

daviddavid

Remove this line.

daviddavid

Remove this line.

daviddavid

Can you make this alphabetical-ish?

daviddavid

Trailing whitespace.

daviddavid

Alphabetical-ish?

daviddavid

Trailing whitespace.

daviddavid

Why this change? Something seems wrong.

daviddavid

I know fontawesome says to use <i> but we generally use <span> instead.

daviddavid

Remove this line.

daviddavid

Can you make this one big var statement with individual variables separated by commas?

daviddavid

Since these are jquery objects, let's prefix the variable name with $

daviddavid

Space between if and (. We probably should also use embedBox.is(':visible') instead of checking the CSS value.

daviddavid

.css('display', 'block') is equivalent to .show()

daviddavid

This is the same as embedBox.hide()

daviddavid

Please define a constant for the 5000.

daviddavid

embedBox.hide()

daviddavid

Trailing whitespace.

daviddavid

We format these like: embedBox .on('mouseenter' function() { // ... }) .on('mouseleave', function() { // ... });

daviddavid

Space between function() and {

daviddavid

Indentation is wacky here.

daviddavid

embedBox.hide()

daviddavid

Please define a constant for the 1500.

daviddavid

Trailing whitespace.

daviddavid

This input should have the readonly property.

daviddavid

This input should have the readonly property.

daviddavid

Trailing whitespace.

daviddavid

It looks like this file probably overlaps a lot with diff_file_fragment.html. Is it possible to abstract out the common parts?

daviddavid

Please use <span> instead of <i>

daviddavid

Trailing whitespace.

daviddavid

Indentation within templates should be 1 space.

daviddavid

Please mark this for translation ({% trans "Permalink" %}).

daviddavid

Please mark for translation.

daviddavid

Trailing whitespace.

daviddavid

local variable 'diffset' is assigned to but never used

reviewbotreviewbot

local variable 'embed_links' is assigned to but never used

reviewbotreviewbot

Col: 80 E501 line too long (85 > 79 characters)

reviewbotreviewbot

Can we define this as its own patterns named diffviewer_embed_urls, and then include that from diffviewer_revision_urls? The it won't need …

daviddavid

Javascript should be indented 4 spaces (python also 4, less is 2, templates are 1). Yeah, I'd love to just …

daviddavid

If you're working on the latest master (with the pipeline changes that have gone in over the last few days), …

daviddavid

Col: 80 E501 line too long (80 > 79 characters)

reviewbotreviewbot

Col: 9 E122 continuation line missing indentation or outdented

reviewbotreviewbot

Col: 13 E128 continuation line under-indented for visual indent

reviewbotreviewbot

Trailing whitespace.

brenniebrennie

Remove this line.

brenniebrennie

Instead of returning false, this should take an event argument and do: e.preventDefault().

brenniebrennie

Indent with 4.

brenniebrennie

/** Please indent this file with 4 spaces instead of 2.

brenniebrennie

/**

brenniebrennie

"Show and hide"

brenniebrennie

How about toggleEmbedBox ?

brenniebrennie

You don't need window for clearTimeout.

brenniebrennie

Here this will also be the wrong thing. See below comment about _.bind vs ES6 fat arrow functions.

brenniebrennie

This function will have this set to the $embedBox element. Therefore, this.FADE_DURATION and this.EMBED_BOX_SHORT_TIMER will be undefined. You'll want to …

brenniebrennie

Fix indentation of the block statements.

brenniebrennie

One less space here.

brenniebrennie

Space between = and \

daviddavid

You don't need to pass in self when calling super methods.

daviddavid

Would be simpler as: context['review_request'] = self.review_request

daviddavid

This should probably be a separate change.

daviddavid

Should be indented 2 more spaces.

daviddavid

Indentation is kind of wacky here.

daviddavid

Since you're using .es6.js, this can be: const $embedBox = ...; let longTimer; let shortTimer;

daviddavid

This can be shorter: $embedBox.fadeOut(this.FADE_DURATION, () => $embedBox.hide());

daviddavid

This can be a bit shorter: $embedBox.fadeOut(this.FADE_DURATION, () => $embedBox.hide());

daviddavid

This needs to be indented an additional 4 spaces.

daviddavid

Fat arrow function?

daviddavid

You don't need the {} around the inner function. For wrapping purposes you could put () => ... on the …

daviddavid

'login_required' imported but unused

reviewbotreviewbot

'augment_method_from' imported but unused

reviewbotreviewbot

Should include "Args" and "Returns" section.

daviddavid

Tiny nit, but maybe swap the order of these so they match the order in the dict below?

daviddavid

Please add a docstring.

daviddavid

Please add Args/Returns.

daviddavid

Remove this extra line.

daviddavid

Please use "let" instead of "var"

daviddavid

This can use a fat arrow function.

daviddavid
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/urls.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/urls.py
    
    
  2. reviewboard/reviews/views.py (Diff revision 1)
     
     
    Show all issues
    Col: 1
     E302 expected 2 blank lines, found 1
    
  3. reviewboard/reviews/views.py (Diff revision 1)
     
     
    Show all issues
    Col: 80
     E501 line too long (82 > 79 characters)
    
  4. reviewboard/reviews/views.py (Diff revision 1)
     
     
    Show all issues
    Col: 80
     E501 line too long (101 > 79 characters)
    
  5. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/urls.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/urls.py
    
    
  2. reviewboard/reviews/views.py (Diff revision 2)
     
     
    Show all issues
    Col: 1
     E302 expected 2 blank lines, found 1
    
  3. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/urls.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/urls.py
    
    
  2. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/templates/diffviewer/file_diff.html
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/templates/diffviewer/file_diff.html
    
    
  2. reviewboard/reviews/views.py (Diff revision 4)
     
     
    Show all issues
    Col: 28
     W291 trailing whitespace
    
  3. reviewboard/reviews/views.py (Diff revision 4)
     
     
    Show all issues
    Col: 30
     W291 trailing whitespace
    
  4. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/templates/diffviewer/file_diff.html
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/templates/diffviewer/file_diff.html
    
    
  2. 
      
mike_conley
  1. 
      
  2. reviewboard/reviews/views.py (Diff revision 5)
     
     
     
     
     

    It might be worth examining how ReviewsDiffFragmentView works (as well as the base class DiffFragmentView). It looks like that thing takes a review_request_id, a revision, and a filediff_id, and spits out... well, diff fragments, which sounds like what you want. You might be able to re-use some machinery here.

  3. 
      
brennie
  1. 
      
  2. reviewboard/reviews/views.py (Diff revision 5)
     
     
     
     
     
     
     
    Show all issues

    Can you format this so that each parameter is not on its own line?

  3. reviewboard/reviews/views.py (Diff revision 5)
     
     
     
     
     
    Show all issues

    Docstrings should be of the form:

    """Single line summary.
    
    Multi-line description.
    """
    

    This is also missing an Args and Returns block, e.g.:

    """
    ...
    
    Args:
        request (django.http.HttpRequest):
            The HTTP request.
    
        review_request_id (type of review_request_id):
            Description of review_request_id.'
    
        ...
    
    Returns:
        django.http.HttpResponse:
        A description of the return value.
    """
    
  4. Show all issues

    We use the imperitive mood for doc strings and doc comment, so this should read as:

    "Initialize the file diff embed page."

  5. Show all issues

    We use the imperitive mood for doc strings and doc comment, so this should read as:

    "Initialize the file diff embed page."

  6. Show all issues

    "Remove"

  7. Show all issues

    "Render"

  8. Show all issues

    render() should return this;.

  9. Show all issues

    Put constants at the beginning

  10. Show all issues

    This doesn't do anything.

  11. 
      
david
  1. Just a couple very-high-level comments:

  2. reviewboard/reviews/views.py (Diff revision 5)
     
     
     
     
     
     
     
    Show all issues

    Function-based views are on their way out, and we should probably not write new ones. Can we make this a class-based view?

  3. Show all issues

    We can dispense with the whole router thing since users won't be able to change what revision they're looking at. This should simplify things quite a bit.

  4. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/templates/diffviewer/file_diff.html
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/templates/diffviewer/file_diff.html
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. 
      
SA
SA
SA
SA
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. reviewboard/reviews/urls.py (Diff revision 7)
     
     
    Show all issues
    Col: 60
     W291 trailing whitespace
    
  3. reviewboard/reviews/urls.py (Diff revision 7)
     
     
    Show all issues
     'DiffViewerView' imported but unused
    
  4. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/css/pages/diffviewer.less
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/css/pages/diffviewer.less
    
    
  2. reviewboard/diffviewer/views.py (Diff revision 8)
     
     
    Show all issues
    Col: 1
     E302 expected 2 blank lines, found 1
    
  3. reviewboard/diffviewer/views.py (Diff revision 8)
     
     
    Show all issues
    Col: 80
     E501 line too long (87 > 79 characters)
    
  4. reviewboard/diffviewer/views.py (Diff revision 8)
     
     
    Show all issues
    Col: 80
     E501 line too long (80 > 79 characters)
    
  5. reviewboard/diffviewer/views.py (Diff revision 8)
     
     
    Show all issues
    Col: 1
     W293 blank line contains whitespace
    
  6. reviewboard/diffviewer/views.py (Diff revision 8)
     
     
    Show all issues
    Col: 5
     E303 too many blank lines (2)
    
  7. reviewboard/diffviewer/views.py (Diff revision 8)
     
     
    Show all issues
    Col: 1
     W293 blank line contains whitespace
    
  8. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/css/pages/diffviewer.less
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/css/pages/diffviewer.less
    
    
  2. reviewboard/diffviewer/views.py (Diff revision 9)
     
     
    Show all issues
    Col: 9
     E122 continuation line missing indentation or outdented
    
  3. reviewboard/diffviewer/views.py (Diff revision 9)
     
     
    Show all issues
    Col: 13
     E122 continuation line missing indentation or outdented
    
  4. reviewboard/diffviewer/views.py (Diff revision 9)
     
     
    Show all issues
    Col: 20
     E251 unexpected spaces around keyword / parameter equals
    
  5. reviewboard/diffviewer/views.py (Diff revision 9)
     
     
    Show all issues
    Col: 19
     E702 multiple statements on one line (semicolon)
    
  6. reviewboard/diffviewer/views.py (Diff revision 9)
     
     
    Show all issues
     local variable 'diffset' is assigned to but never used
    
  7. reviewboard/diffviewer/views.py (Diff revision 9)
     
     
    Show all issues
    Col: 9
     E122 continuation line missing indentation or outdented
    
  8. reviewboard/diffviewer/views.py (Diff revision 9)
     
     
    Show all issues
    Col: 19
     E702 multiple statements on one line (semicolon)
    
  9. reviewboard/reviews/views.py (Diff revision 9)
     
     
    Show all issues
     'build_server_url' imported but unused
    
  10. 
      
SA
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/css/pages/diffviewer.less
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/css/pages/diffviewer.less
    
    
  2. 
      
SA
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. 
      
david
  1. This is a long review but it's mostly pretty simple stuff. I'm very happy with how this is going!

  2. Show all issues

    Can we maybe add some cute link back to the main diff that says something like "View this change on Review Board"?

  3. Show all issues

    These fonts seem... large.

  4. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
     
     
     
     
     
    Show all issues

    These should all be sorted in alphabetical order.

  5. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    Undo this line deletion.

  6. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    Undo this line addition.

  7. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    This seems to share a lot with DiffFragmentView. Can we create some intermediate parent class for both that includes the shared code?

  8. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    If there's no docstring, the first line can be immediately after the class ... line. But maybe it's better to add a docstring.

  9. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    No blank line here (and/or add a docstring).

  10. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    Can we log the exception as well?

  11. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    Can we log the exception as well?

  12. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    No blank line and/or add a docstring.

  13. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    I know this is just copy/pasted, but we're trying to move towards using the imperative mood for docstrings as per PEP-257. Therefore this should be "Create the renderer" rather than "Creates the renderer"

  14. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    Mind adding "Args:" and "Returns:" sections as per https://www.reviewboard.org/docs/codebase/dev/ ?

  15. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    Mind adding "Args:" and "Returns:" sections as per https://www.reviewboard.org/docs/codebase/dev/ ?

  16. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    Should be "Fetch ..."

  17. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    Mind adding "Args:" and "Returns:" sections as per https://www.reviewboard.org/docs/codebase/dev/ ?

  18. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    No blank line and/or docstring.

  19. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    No blank line here.

  20. reviewboard/diffviewer/views.py (Diff revision 11)
     
     
    Show all issues

    No blank line here, docstring.

  21. reviewboard/reviews/urls.py (Diff revision 11)
     
     
    Show all issues

    Can you put this on the previous line?

    name="diff-fragment-view"),
    
  22. reviewboard/reviews/urls.py (Diff revision 11)
     
     
    Show all issues

    Should go on the previous line.

  23. reviewboard/reviews/views.py (Diff revision 11)
     
     
    Show all issues

    Please put this line back.

  24. reviewboard/reviews/views.py (Diff revision 11)
     
     
    Show all issues

    Remove this line.

  25. reviewboard/reviews/views.py (Diff revision 11)
     
     
    Show all issues

    Remove this line.

  26. reviewboard/static/rb/css/pages/diffviewer.less (Diff revision 11)
     
     
     
     
     
     
     
     
     
     
    Show all issues

    Can you make this alphabetical-ish?

  27. Show all issues

    Trailing whitespace.

  28. reviewboard/static/rb/css/pages/diffviewer.less (Diff revision 11)
     
     
     
     
     
     
     
    Show all issues

    Alphabetical-ish?

  29. Show all issues

    Trailing whitespace.

  30. reviewboard/static/rb/css/pages/reviews.less (Diff revision 11)
     
     
     
    Show all issues

    Why this change? Something seems wrong.

    1. The commented out line @{STATIC_ROOT} was looking in the wrong place for markdown.less and was throwing an error. Not a clean fix, but it allowed the file to load properly. Any idea for a better alternative or why @{STATIC_ROOT} would be wrong?

  31. Show all issues

    I know fontawesome says to use <i> but we generally use <span> instead.

  32. Show all issues

    Remove this line.

  33. reviewboard/static/rb/js/pages/views/diffViewerPageView.js (Diff revision 11)
     
     
     
     
     
     
    Show all issues

    Can you make this one big var statement with individual variables separated by commas?

  34. Show all issues

    Since these are jquery objects, let's prefix the variable name with $

  35. Show all issues

    Space between if and (. We probably should also use embedBox.is(':visible') instead of checking the CSS value.

  36. Show all issues

    .css('display', 'block') is equivalent to .show()

  37. Show all issues

    This is the same as embedBox.hide()

  38. Show all issues

    Please define a constant for the 5000.

  39. Show all issues

    embedBox.hide()

  40. Show all issues

    Trailing whitespace.

  41. reviewboard/static/rb/js/pages/views/diffViewerPageView.js (Diff revision 11)
     
     
     
     
     
     
    Show all issues

    We format these like:

    embedBox
        .on('mouseenter' function() {
            // ...
        })
        .on('mouseleave', function() {
            // ...
        });
    
  42. Show all issues

    Space between function() and {

  43. Show all issues

    Indentation is wacky here.

  44. Show all issues

    embedBox.hide()

  45. Show all issues

    Please define a constant for the 1500.

  46. Show all issues

    Trailing whitespace.

  47. Show all issues

    This input should have the readonly property.

  48. Show all issues

    This input should have the readonly property.

  49. Show all issues

    Trailing whitespace.

  50. Show all issues

    It looks like this file probably overlaps a lot with diff_file_fragment.html. Is it possible to abstract out the common parts?

  51. Show all issues

    Please use <span> instead of <i>

  52. Show all issues

    Trailing whitespace.

  53. Show all issues

    Indentation within templates should be 1 space.

  54. Show all issues

    Please mark this for translation ({% trans "Permalink" %}).

  55. Show all issues

    Please mark for translation.

  56. Show all issues

    Trailing whitespace.

  57. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. reviewboard/diffviewer/views.py (Diff revision 12)
     
     
    Show all issues
     local variable 'diffset' is assigned to but never used
    
  3. reviewboard/diffviewer/views.py (Diff revision 12)
     
     
    Show all issues
     local variable 'embed_links' is assigned to but never used
    
  4. reviewboard/diffviewer/views.py (Diff revision 12)
     
     
    Show all issues
    Col: 80
     E501 line too long (85 > 79 characters)
    
  5. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/utils/fileDiffUtils.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/utils/fileDiffUtils.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/reviews/urls.py (Diff revision 14)
     
     
     
     
     
     
     
     
     
     
    Show all issues

    Can we define this as its own patterns named diffviewer_embed_urls, and then include that from diffviewer_revision_urls? The it won't need the <revision> capture.

  3. reviewboard/static/rb/js/utils/fileDiffUtils.js (Diff revision 14)
     
     
     
     
     
     
    Show all issues

    Javascript should be indented 4 spaces (python also 4, less is 2, templates are 1). Yeah, I'd love to just standardize everywhere :(

  4. Show all issues

    If you're working on the latest master (with the pipeline changes that have gone in over the last few days), you should change this to load the pipeline tags, and then change compressed_css to stylesheet and compressed_js to javascript.

  5. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/utils/fileDiffUtils.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/utils/fileDiffUtils.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/utils/fileDiffUtils.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/utils/fileDiffUtils.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. reviewboard/reviews/views.py (Diff revision 16)
     
     
    Show all issues
    Col: 80
     E501 line too long (80 > 79 characters)
    
  3. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/utils/fileDiffUtils.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/utils/fileDiffUtils.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. reviewboard/reviews/views.py (Diff revision 17)
     
     
    Show all issues
    Col: 9
     E122 continuation line missing indentation or outdented
    
  3. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/utils/fileDiffUtils.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/utils/fileDiffUtils.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. reviewboard/reviews/views.py (Diff revision 18)
     
     
    Show all issues
    Col: 13
     E128 continuation line under-indented for visual indent
    
  3. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/utils/fileDiffUtils.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/utils/fileDiffUtils.js
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. 
      
brennie
  1. 
      
  2. Show all issues

    Trailing whitespace.

  3. Show all issues

    Remove this line.

  4. Show all issues

    Instead of returning false, this should take an event argument and do: e.preventDefault().

  5. Show all issues

    Indent with 4.

  6. Show all issues

    /**
    

    Please indent this file with 4 spaces instead of 2.

    1. This file is already indented with 4 spaces.

  7. Show all issues

    /**
    
    1. I don't know what this means. Should I use two asterisks here instead of one?

    2. Yeah. Our doc generation will look for comments that start with /** to associate with their attached classes/methods/etc.

  8. Show all issues

    "Show and hide"

  9. Show all issues

    How about toggleEmbedBox ?

    1. Much better name! Thanks!

  10. Show all issues

    You don't need window for clearTimeout.

  11. reviewboard/static/rb/js/utils/fileDiffUtils.js (Diff revision 19)
     
     
     
     
     
     
     
     
    Show all issues

    Here this will also be the wrong thing. See below comment about _.bind vs ES6 fat arrow functions.

    1. These functions actually seem to work. In this case the context of this is the input element and the text area element, which is what we want to select.

    2. Yeah. I almost made this same comment too but it's right. Maybe add a comment to these explaining that it's intentional?

  12. reviewboard/static/rb/js/utils/fileDiffUtils.js (Diff revision 19)
     
     
     
     
     
     
     
     
    Show all issues

    This function will have this set to the $embedBox element. Therefore, this.FADE_DURATION and this.EMBED_BOX_SHORT_TIMER will be undefined.

    You'll want to use _.bind() as such:

    $embedBox
        .on(/* ... */)
        .on('mouseleave', _.bind(function() {
            shortTimer = setTimeout(_.bind(function() {
                $embedBox.fadeOut(this.FADE_DURATION, function() {
                    $embedBox.hide();
                });
            }, this), this.EMBED_BOX_SHORT_DURATION);
        }, this));
    

    Another option, however, is to use ES6 functionality for this. The latest master and release-2.6.x branches support ES6 when JS files are named .es6.js. Then you could use:

    $embedBox
        .on(/* ... */)
        .on('mouseleave', () => {
            shortTimer = setTimeout(() => {
                $embedBox.fadeOut(this.FADE_DURATION, () => {
                    $embedBox.hide();
                });
            }, this.EMBED_BOX_SHORT_DURATION);
        });
    

    which is much cleaner.

    1. Awesome! Fat arrows are amaaaaaazzzzing.

  13. Show all issues

    Fix indentation of the block statements.

  14. Show all issues

    One less space here.

  15. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/js/utils/fileDiffUtils.es6.js
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/js/utils/fileDiffUtils.es6.js
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/diffviewer/views.py (Diff revision 20)
     
     
     
    Show all issues

    Space between = and \

  3. reviewboard/reviews/views.py (Diff revision 20)
     
     
    Show all issues

    You don't need to pass in self when calling super methods.

  4. reviewboard/reviews/views.py (Diff revision 20)
     
     
     
     
    Show all issues

    Would be simpler as:

    context['review_request'] = self.review_request
    
  5. Show all issues

    This should probably be a separate change.

    1. What do you mean by separate change?

    2. I mean make a new commit and review request for it, since it's not related to the other changes.

  6. Show all issues

    Should be indented 2 more spaces.

  7. reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js (Diff revision 20)
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    Indentation is kind of wacky here.

  8. Show all issues

    Since you're using .es6.js, this can be:

    const $embedBox = ...;
    let longTimer;
    let shortTimer;
    
  9. Show all issues

    This can be shorter:

    $embedBox.fadeOut(this.FADE_DURATION,
                      () => $embedBox.hide());
    
  10. Show all issues

    This can be a bit shorter:

    $embedBox.fadeOut(this.FADE_DURATION,
                      () => $embedBox.hide());
    
  11. reviewboard/static/rb/js/utils/fileDiffUtils.es6.js (Diff revision 20)
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    This needs to be indented an additional 4 spaces.

  12. Show all issues

    Fat arrow function?

  13. Show all issues

    You don't need the {} around the inner function. For wrapping purposes you could put () => ... on the next line, aligned with this.FADE_DURATION.

  14. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/js/utils/fileDiffUtils.es6.js
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/staticbundles.py
        reviewboard/diffviewer/views.py
        reviewboard/reviews/urls.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/fileDiffEmbedView.js
        reviewboard/templates/diffviewer/diff_file_fragment_embed.html
        reviewboard/static/rb/css/pages/diffviewer.less
        reviewboard/templates/diffviewer/diff_file_fragment.html
        reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js
        reviewboard/static/rb/js/utils/fileDiffUtils.es6.js
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. reviewboard/diffviewer/views.py (Diff revision 21)
     
     
    Show all issues
     'login_required' imported but unused
    
  3. reviewboard/diffviewer/views.py (Diff revision 21)
     
     
    Show all issues
     'augment_method_from' imported but unused
    
  4. 
      
david
  1. Existing code is often using a mix of styles, but for new code, we'd like docstrings to be consistent. Please see https://www.reviewboard.org/docs/codebase/dev/docs/writing-codebase-docs/ for details on how things should be formatted.

  2. reviewboard/diffviewer/views.py (Diff revision 21)
     
     
    Show all issues

    Should include "Args" and "Returns" section.

  3. reviewboard/diffviewer/views.py (Diff revision 21)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    Tiny nit, but maybe swap the order of these so they match the order in the dict below?

  4. reviewboard/diffviewer/views.py (Diff revision 21)
     
     
    Show all issues

    Please add a docstring.

  5. reviewboard/diffviewer/views.py (Diff revision 21)
     
     
    Show all issues

    Please add Args/Returns.

  6. reviewboard/diffviewer/views.py (Diff revision 21)
     
     
    Show all issues

    Remove this extra line.

  7. Show all issues

    Please use "let" instead of "var"

  8. Show all issues

    This can use a fat arrow function.

  9. 
      
david
Review request changed
Status:
Discarded