Disable pylint failures

pylint reports some invalid synstax but they might
be caused from pylint bugs so that we should supress them
tentatively for gates to work well.

The reasons we can disable these reported invalid syntax as follows:

- no-name-in-module:
  pylint seems not to search pkg_resource dir correctly. [1]

- super-on-old-class:
  This error must occur on using old style initialization like as calling
  parent's '__init__' method but the reported line is according to new style
  using "super" method. [2]

- print-statement:
  It's needed for python3 compatiblity but currently swift3 doesn't support it.
  We should fix it when python3 supported.

[1]:http://stackoverflow.com/questions/6336882/
    pylint-doesnt-like-pkg-resources-resource-filename
[2]:http://docs.pylint.org/features.html

Change-Id: I127cefa786f4ab86de11e01b7361ba348897a8eb
Closes-Bug: #1395768
This commit is contained in:
Kota Tsuyuzaki
2014-11-26 02:15:39 -08:00
parent 3b6c98dda7
commit 57ba429d3a
3 changed files with 6 additions and 3 deletions

View File

@@ -16,8 +16,7 @@
import lxml.etree
from urllib import quote
from copy import deepcopy
from pkg_resources import resource_stream
from pkg_resources import resource_stream # pylint: disable-msg=E0611
from swift3.exception import S3Exception
from swift3.utils import LOGGER, camel_to_snake, utf8encode, utf8decode
@@ -115,6 +114,7 @@ class _Element(lxml.etree.ElementBase):
codes from swift3 middleware.
"""
def __init__(self, *args, **kwargs):
# pylint: disable-msg=E1002
super(_Element, self).__init__(*args, **kwargs)
@property

View File

@@ -521,7 +521,8 @@ class Request(swob.Request):
err_msg = resp.body
if status in error_codes:
err_resp = error_codes[sw_resp.status_int]
err_resp = \
error_codes[sw_resp.status_int] # pylint: disable-msg=E1101
if isinstance(err_resp, tuple):
raise err_resp[0](*err_resp[1:])
else:

View File

@@ -55,6 +55,8 @@ class FakeSwift(object):
resp_class, raw_headers, body = self._responses[(method, path)]
headers = swob.HeaderKeyDict(raw_headers)
except KeyError:
# FIXME: suppress print state error for python3 compatibility.
# pylint: disable-msg=E1601
if (env.get('QUERY_STRING')
and (method, env['PATH_INFO']) in self._responses):
resp_class, raw_headers, body = self._responses[