Fix PEP-8 issues with some more code.
Review Request #4424 — Created Aug. 12, 2013 and submitted
Fix PEP-8 issues with some more code. This addresses problems in the attachments, changedescs, cmdline, and diffviewer modules.
Ran unit tests, pep8 command-line tool.
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/tests.py reviewboard/attachments/__init__.py reviewboard/diffviewer/smdiff.py reviewboard/diffviewer/evolutions/add_diff_hash.py reviewboard/diffviewer/parser.py reviewboard/diffviewer/evolutions/filediff_status.py reviewboard/changedescs/tests.py reviewboard/cmdline/rbsite.py reviewboard/attachments/forms.py reviewboard/diffviewer/managers.py reviewboard/diffviewer/opcode_generator.py reviewboard/diffviewer/templatetags/difftags.py reviewboard/attachments/mimetypes.py reviewboard/diffviewer/myersdiff.py reviewboard/diffviewer/differ.py reviewboard/diffviewer/evolutions/add_parent_diffs.py reviewboard/diffviewer/models.py reviewboard/diffviewer/diffutils.py reviewboard/cmdline/rbssh.py reviewboard/attachments/tests.py reviewboard/diffviewer/views.py Ignored Files:
-
-
This doesn't really help readability of the content, but concatenating strings is bad anyway. While you're here, can you turn this into one big list statement that's joined?
-
Hmmm, yeah, I hate this so much. I don't really have a suggestion, but I hate it, and I don't expect I'll be writing code that looks like this. I would much, much rather ignore what the pep8 tool says here. This is a warning form the tool, not PEP-8 itself, and from discussions on their bug tracker, it's clearly the developers' preference, which is less "holy" than PEP-8 (which is itself very inconsistent with how it does multi-line if statements). A bunch of code shipped with Python uses the left-hand side. (Relevant discussion involving this in the pep8 tool is at https://github.com/jcrocholl/pep8/issues/126, and also buried in some other tickets elsewhere.) My personal preference is to just keep them aligned. There's the issue of figuring out where the if statement ends and the other code begins, but I don't feel we've realistically had a problem with this over the many years of writing Review Board (or, for that matter, C code that has braces on the same line as the if statement), and maybe it just will encourage more useful comments in the body.
-
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/tests.py reviewboard/attachments/__init__.py reviewboard/diffviewer/smdiff.py reviewboard/diffviewer/evolutions/add_diff_hash.py reviewboard/diffviewer/parser.py reviewboard/diffviewer/evolutions/filediff_status.py reviewboard/changedescs/tests.py reviewboard/cmdline/rbsite.py reviewboard/attachments/forms.py reviewboard/diffviewer/managers.py reviewboard/diffviewer/opcode_generator.py reviewboard/diffviewer/templatetags/difftags.py reviewboard/attachments/mimetypes.py reviewboard/diffviewer/myersdiff.py reviewboard/diffviewer/differ.py reviewboard/diffviewer/evolutions/add_parent_diffs.py reviewboard/diffviewer/models.py reviewboard/diffviewer/diffutils.py reviewboard/cmdline/rbssh.py reviewboard/attachments/tests.py reviewboard/diffviewer/views.py Ignored Files:
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/tests.py reviewboard/attachments/__init__.py reviewboard/diffviewer/smdiff.py reviewboard/diffviewer/evolutions/add_diff_hash.py reviewboard/diffviewer/parser.py reviewboard/diffviewer/evolutions/filediff_status.py reviewboard/changedescs/tests.py reviewboard/cmdline/rbsite.py reviewboard/attachments/forms.py reviewboard/diffviewer/managers.py reviewboard/diffviewer/opcode_generator.py reviewboard/diffviewer/templatetags/difftags.py reviewboard/attachments/mimetypes.py reviewboard/diffviewer/myersdiff.py reviewboard/diffviewer/differ.py reviewboard/diffviewer/evolutions/add_parent_diffs.py reviewboard/diffviewer/models.py reviewboard/diffviewer/diffutils.py reviewboard/cmdline/rbssh.py reviewboard/attachments/tests.py reviewboard/diffviewer/views.py Ignored Files: