[ https://issues.apache.org/jira/browse/THRIFT-1480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178864#comment-13178864 ]
Hudson commented on THRIFT-1480: -------------------------------- Integrated in Thrift #374 (See [https://builds.apache.org/job/Thrift/374/]) THRIFT-1480. py: remove tabs, adjust whitespace and address PEP8 warnings This patch addresses a host of PEP8 lint problems. Patch: Will Pierce bryanduxbury : http://svn.apache.org/viewvc/?view=rev&rev=1226890 Files : * /thrift/trunk/lib/py/src/TSCons.py * /thrift/trunk/lib/py/src/TSerialization.py * /thrift/trunk/lib/py/src/Thrift.py * /thrift/trunk/lib/py/src/protocol/TBase.py * /thrift/trunk/lib/py/src/protocol/TBinaryProtocol.py * /thrift/trunk/lib/py/src/protocol/TCompactProtocol.py * /thrift/trunk/lib/py/src/protocol/TProtocol.py * /thrift/trunk/lib/py/src/server/THttpServer.py * /thrift/trunk/lib/py/src/server/TNonblockingServer.py * /thrift/trunk/lib/py/src/server/TProcessPoolServer.py * /thrift/trunk/lib/py/src/server/TServer.py * /thrift/trunk/lib/py/src/transport/THttpClient.py * /thrift/trunk/lib/py/src/transport/TSSLSocket.py * /thrift/trunk/lib/py/src/transport/TSocket.py * /thrift/trunk/lib/py/src/transport/TTransport.py * /thrift/trunk/lib/py/src/transport/TTwisted.py * /thrift/trunk/lib/py/src/transport/TZlibTransport.py * /thrift/trunk/lib/py/src/transport/__init__.py > python: remove tabs, adjust whitespace and address PEP8 warnings > ---------------------------------------------------------------- > > Key: THRIFT-1480 > URL: https://issues.apache.org/jira/browse/THRIFT-1480 > Project: Thrift > Issue Type: Improvement > Components: Python - Library > Reporter: Will Pierce > Assignee: Will Pierce > Priority: Minor > Fix For: 0.9 > > Attachments: THRIFT-1480-pep8ify-v1.patch > > > The python library files have some inconsistencies (different indent levels > and docstring placement) and the pep8 linter produces dozens of warnings. > There are also several places where tabs are used instead of spaces, which is > not good. > This patch addresses almost all of the pep8 issues with as little > modification of the code as possible. > This patch: > * converts 3 instances of tabs into the correct number of spaces > * removes unnecessary trailing semicolons and backslashes > * changes None comparisons to be identity based, 'x != None' becomes 'x is > not None' in a handful of places > * removes unnecessary '== True' in one if statement > * wraps lines at 80 characters and removes trailing whitespace > * corrects a handful of grammar problems in docstrings (mostly to help with > 80 char line wrap) > * converts all the docstrings to use """ (instead of ''' or ") and makes > placement consistent > * fixes pep8 warnings about missing spaces around operators, e.g. (a-b) > becomes (a - b) > * adjusts ordering of stdlib imports to be alphabetical (could be better > still) > * correct internal indent depths of methods when they switch from 2 to 4 > spaces > There's a mix of files that use 4-spaces for indentation, versus the majority > which use 2-spaces for indentation. This patch doesn't change that. I > wanted to get the code as pep8 clean as possible and touch as few lines as > possible to get it there. The TType constants defined in Thrift.py have some > nice vertical whitespace that isn't pep8-happy, but it looked too clean to > touch so I left it unchanged. > After this patch, the pep8 utility only reports two warnings: > # "indentation is not a multiple of four" for most files (no biggie) > # "multiple spaces before operator" in Thrift.py for the TTypes class > constants > The unit tests all pass with this patch. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira