Add workarounds for issues with pylint tip.
This commit is contained in:
parent
66b337c2b1
commit
1d2683993e
@ -59,4 +59,4 @@ defining-attr-methods=__init__,__new__,setUp
|
|||||||
max-args=10
|
max-args=10
|
||||||
|
|
||||||
[TYPECHECK]
|
[TYPECHECK]
|
||||||
ignored-classes=WebElementWrapper,AnsiCodes,UnsetObject
|
ignored-classes=WebElementWrapper,AnsiCodes,UnsetObject,MsgType
|
||||||
|
@ -95,7 +95,8 @@ class UrlMarkManager(QObject):
|
|||||||
return
|
return
|
||||||
|
|
||||||
self._init_lineparser()
|
self._init_lineparser()
|
||||||
for line in self._lineparser:
|
# WORKAROUND for https://bitbucket.org/logilab/pylint/issues/685/
|
||||||
|
for line in self._lineparser: # pylint: disable=not-an-iterable
|
||||||
if not line.strip():
|
if not line.strip():
|
||||||
# Ignore empty or whitespace-only lines.
|
# Ignore empty or whitespace-only lines.
|
||||||
continue
|
continue
|
||||||
|
@ -558,7 +558,8 @@ class ConfigManager(QObject):
|
|||||||
|
|
||||||
def _after_set(self, changed_sect, changed_opt):
|
def _after_set(self, changed_sect, changed_opt):
|
||||||
"""Clean up caches and emit signals after an option has been set."""
|
"""Clean up caches and emit signals after an option has been set."""
|
||||||
self.get.cache_clear()
|
# WORKAROUND for https://bitbucket.org/logilab/pylint/issues/659/
|
||||||
|
self.get.cache_clear() # pylint: disable=no-member
|
||||||
self._changed(changed_sect, changed_opt)
|
self._changed(changed_sect, changed_opt)
|
||||||
# Options in the same section and ${optname} interpolation.
|
# Options in the same section and ${optname} interpolation.
|
||||||
for optname, option in self.sections[changed_sect].items():
|
for optname, option in self.sections[changed_sect].items():
|
||||||
@ -620,7 +621,8 @@ class ConfigManager(QObject):
|
|||||||
existed = optname in sectdict
|
existed = optname in sectdict
|
||||||
if existed:
|
if existed:
|
||||||
del sectdict[optname]
|
del sectdict[optname]
|
||||||
self.get.cache_clear()
|
# WORKAROUND for https://bitbucket.org/logilab/pylint/issues/659/
|
||||||
|
self.get.cache_clear() # pylint: disable=no-member
|
||||||
return existed
|
return existed
|
||||||
|
|
||||||
@functools.lru_cache()
|
@functools.lru_cache()
|
||||||
|
@ -171,6 +171,8 @@ class BaseType:
|
|||||||
if not value:
|
if not value:
|
||||||
return
|
return
|
||||||
if self.valid_values is not None:
|
if self.valid_values is not None:
|
||||||
|
# WORKAROUND for https://bitbucket.org/logilab/pylint/issues/685/
|
||||||
|
# pylint: disable=unsupported-membership-test
|
||||||
if value not in self.valid_values:
|
if value not in self.valid_values:
|
||||||
raise configexc.ValidationError(
|
raise configexc.ValidationError(
|
||||||
value, "valid values: {}".format(', '.join(
|
value, "valid values: {}".format(', '.join(
|
||||||
@ -192,7 +194,8 @@ class BaseType:
|
|||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
out = []
|
out = []
|
||||||
for val in self.valid_values:
|
# WORKAROUND for https://bitbucket.org/logilab/pylint/issues/685/
|
||||||
|
for val in self.valid_values: # pylint: disable=not-an-iterable
|
||||||
try:
|
try:
|
||||||
desc = self.valid_values.descriptions[val]
|
desc = self.valid_values.descriptions[val]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@ -330,7 +333,8 @@ class FlagList(List):
|
|||||||
|
|
||||||
out = []
|
out = []
|
||||||
# Single value completions
|
# Single value completions
|
||||||
for value in self.valid_values:
|
# WORKAROUND for https://bitbucket.org/logilab/pylint/issues/685/
|
||||||
|
for value in self.valid_values: # pylint: disable=not-an-iterable
|
||||||
desc = self.valid_values.descriptions.get(value, "")
|
desc = self.valid_values.descriptions.get(value, "")
|
||||||
out.append((value, desc))
|
out.append((value, desc))
|
||||||
|
|
||||||
|
@ -62,6 +62,8 @@ class Section:
|
|||||||
|
|
||||||
def __contains__(self, key):
|
def __contains__(self, key):
|
||||||
"""Return whether the section contains a given key."""
|
"""Return whether the section contains a given key."""
|
||||||
|
# WORKAROUND for https://bitbucket.org/logilab/pylint/issues/685/
|
||||||
|
# pylint: disable=unsupported-membership-test
|
||||||
return key in self.values
|
return key in self.values
|
||||||
|
|
||||||
def items(self):
|
def items(self):
|
||||||
|
@ -340,7 +340,8 @@ class IPCServer(QObject):
|
|||||||
self._handle_invalid_data()
|
self._handle_invalid_data()
|
||||||
return
|
return
|
||||||
|
|
||||||
cwd = json_data.get('cwd', None)
|
# WORKAROUND for https://bitbucket.org/logilab/astroid/issues/75/
|
||||||
|
cwd = json_data.get('cwd', None) # pylint: disable=no-member
|
||||||
self.got_args.emit(json_data['args'], json_data['target_arg'], cwd)
|
self.got_args.emit(json_data['args'], json_data['target_arg'], cwd)
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
|
Loading…
Reference in New Issue
Block a user