Adjust pylint exceptions.
This commit is contained in:
parent
cd14ae2f1f
commit
e8e6d8409b
@ -26,7 +26,11 @@ disable=no-self-use,
|
|||||||
blacklisted-name,
|
blacklisted-name,
|
||||||
too-many-lines,
|
too-many-lines,
|
||||||
logging-format-interpolation,
|
logging-format-interpolation,
|
||||||
interface-not-implemented
|
interface-not-implemented,
|
||||||
|
broad-except,
|
||||||
|
bare-except,
|
||||||
|
eval-used,
|
||||||
|
exec-used
|
||||||
|
|
||||||
[BASIC]
|
[BASIC]
|
||||||
module-rgx=(__)?[a-z][a-z0-9_]*(__)?$
|
module-rgx=(__)?[a-z][a-z0-9_]*(__)?$
|
||||||
|
@ -14,7 +14,7 @@ exclude=test_.*
|
|||||||
args=--output-format=colorized,--reports=no,--rcfile=.pylintrc
|
args=--output-format=colorized,--reports=no,--rcfile=.pylintrc
|
||||||
plugins=config,crlf,modeline,settrace,openencoding
|
plugins=config,crlf,modeline,settrace,openencoding
|
||||||
# excluding command.py is a WORKAROUND for https://bitbucket.org/logilab/pylint/issue/395/horrible-performance-related-to-inspect
|
# excluding command.py is a WORKAROUND for https://bitbucket.org/logilab/pylint/issue/395/horrible-performance-related-to-inspect
|
||||||
exclude=resources.py,command.py
|
exclude=resources.py
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
args=--config=.flake8
|
args=--config=.flake8
|
||||||
|
@ -487,7 +487,7 @@ class Application(QApplication):
|
|||||||
QUrl.RemovePassword | QUrl.FullyEncoded)
|
QUrl.RemovePassword | QUrl.FullyEncoded)
|
||||||
if urlstr:
|
if urlstr:
|
||||||
win_pages.append(urlstr)
|
win_pages.append(urlstr)
|
||||||
except Exception: # pylint: disable=broad-except
|
except Exception:
|
||||||
if forgiving:
|
if forgiving:
|
||||||
log.destroy.exception("Error while recovering tab")
|
log.destroy.exception("Error while recovering tab")
|
||||||
else:
|
else:
|
||||||
@ -538,8 +538,6 @@ class Application(QApplication):
|
|||||||
It'll try very hard to write all open tabs to a file, and then exit
|
It'll try very hard to write all open tabs to a file, and then exit
|
||||||
gracefully.
|
gracefully.
|
||||||
"""
|
"""
|
||||||
# pylint: disable=broad-except
|
|
||||||
|
|
||||||
exc = (exctype, excvalue, tb)
|
exc = (exctype, excvalue, tb)
|
||||||
|
|
||||||
if not self._quit_status['crash']:
|
if not self._quit_status['crash']:
|
||||||
@ -682,9 +680,9 @@ class Application(QApplication):
|
|||||||
s: The string to evaluate.
|
s: The string to evaluate.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
r = eval(s) # pylint: disable=eval-used
|
r = eval(s)
|
||||||
out = repr(r)
|
out = repr(r)
|
||||||
except Exception: # pylint: disable=broad-except
|
except Exception:
|
||||||
out = traceback.format_exc()
|
out = traceback.format_exc()
|
||||||
qutescheme.pyeval_output = out
|
qutescheme.pyeval_output = out
|
||||||
tabbed_browser = objreg.get('tabbed-browser', scope='window',
|
tabbed_browser = objreg.get('tabbed-browser', scope='window',
|
||||||
|
@ -951,8 +951,8 @@ class CommandDispatcher:
|
|||||||
@cmdutils.register(instance='command-dispatcher', scope='window')
|
@cmdutils.register(instance='command-dispatcher', scope='window')
|
||||||
def view_source(self):
|
def view_source(self):
|
||||||
"""Show the source of the current page."""
|
"""Show the source of the current page."""
|
||||||
# pylint doesn't seem to like pygments...
|
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
|
# https://bitbucket.org/logilab/pylint/issue/491/
|
||||||
widget = self._current_widget()
|
widget = self._current_widget()
|
||||||
if widget.viewing_source:
|
if widget.viewing_source:
|
||||||
raise cmdexc.CommandError("Already viewing source!")
|
raise cmdexc.CommandError("Already viewing source!")
|
||||||
|
@ -19,7 +19,9 @@
|
|||||||
#
|
#
|
||||||
# pylint complains when using .render() on jinja templates, so we make it shut
|
# pylint complains when using .render() on jinja templates, so we make it shut
|
||||||
# up for this whole module.
|
# up for this whole module.
|
||||||
# pylint: disable=maybe-no-member
|
|
||||||
|
# pylint: disable=no-member
|
||||||
|
# https://bitbucket.org/logilab/pylint/issue/490/
|
||||||
|
|
||||||
"""Handler functions for different qute:... pages.
|
"""Handler functions for different qute:... pages.
|
||||||
|
|
||||||
|
@ -24,8 +24,7 @@ import urllib.parse
|
|||||||
import string
|
import string
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import pypeg2 as peg # pylint: disable=import-error
|
import pypeg2 as peg
|
||||||
# (fails on win7 in venv...)
|
|
||||||
|
|
||||||
from qutebrowser.utils import log, utils
|
from qutebrowser.utils import log, utils
|
||||||
|
|
||||||
@ -293,7 +292,9 @@ def normalize_ws(text):
|
|||||||
|
|
||||||
def parse_headers(content_disposition):
|
def parse_headers(content_disposition):
|
||||||
"""Build a ContentDisposition from header values."""
|
"""Build a ContentDisposition from header values."""
|
||||||
# pylint: disable=maybe-no-member
|
# https://bitbucket.org/logilab/pylint/issue/492/
|
||||||
|
# pylint: disable=no-member
|
||||||
|
|
||||||
# We allow non-ascii here (it will only be parsed inside of qdtext, and
|
# We allow non-ascii here (it will only be parsed inside of qdtext, and
|
||||||
# rejected by the grammar if it appears in other places), although parsing
|
# rejected by the grammar if it appears in other places), although parsing
|
||||||
# it can be ambiguous. Parsing it ensures that a non-ambiguous filename*
|
# it can be ambiguous. Parsing it ensures that a non-ambiguous filename*
|
||||||
|
@ -163,7 +163,9 @@ class BrowserPage(QWebPage):
|
|||||||
info.domain, info.error))
|
info.domain, info.error))
|
||||||
title = "Error loading page: {}".format(urlstr)
|
title = "Error loading page: {}".format(urlstr)
|
||||||
template = jinja.env.get_template('error.html')
|
template = jinja.env.get_template('error.html')
|
||||||
html = template.render( # pylint: disable=maybe-no-member
|
# pylint: disable=no-member
|
||||||
|
# https://bitbucket.org/logilab/pylint/issue/490/
|
||||||
|
html = template.render(
|
||||||
title=title, url=urlstr, error=error_str, icon='')
|
title=title, url=urlstr, error=error_str, icon='')
|
||||||
errpage.content = html.encode('utf-8')
|
errpage.content = html.encode('utf-8')
|
||||||
errpage.encoding = 'utf-8'
|
errpage.encoding = 'utf-8'
|
||||||
|
@ -79,6 +79,7 @@ class SettingValue:
|
|||||||
if val is not None:
|
if val is not None:
|
||||||
return val
|
return val
|
||||||
else: # pylint: disable=useless-else-on-loop
|
else: # pylint: disable=useless-else-on-loop
|
||||||
|
# https://bitbucket.org/logilab/pylint/issue/489/
|
||||||
raise ValueError("No valid config value found!")
|
raise ValueError("No valid config value found!")
|
||||||
|
|
||||||
def transformed(self):
|
def transformed(self):
|
||||||
|
@ -166,7 +166,7 @@ class BaseKeyParser(QObject):
|
|||||||
return self.Match.none
|
return self.Match.none
|
||||||
|
|
||||||
if len(txt) == 1:
|
if len(txt) == 1:
|
||||||
category = unicodedata.category(txt) # pylint: disable=no-member
|
category = unicodedata.category(txt)
|
||||||
is_control_char = (category == 'Cc')
|
is_control_char = (category == 'Cc')
|
||||||
else:
|
else:
|
||||||
is_control_char = False
|
is_control_char = False
|
||||||
|
@ -183,7 +183,7 @@ class MainWindow(QWidget):
|
|||||||
|
|
||||||
def _connect_signals(self):
|
def _connect_signals(self):
|
||||||
"""Connect all mainwindow signals."""
|
"""Connect all mainwindow signals."""
|
||||||
# pylint: disable=too-many-locals,too-many-statements
|
# pylint: disable=too-many-statements
|
||||||
key_config = objreg.get('key-config')
|
key_config = objreg.get('key-config')
|
||||||
|
|
||||||
status = self._get_object('statusbar')
|
status = self._get_object('statusbar')
|
||||||
|
@ -202,7 +202,6 @@ class StatusBar(QWidget):
|
|||||||
Return:
|
Return:
|
||||||
The severity as a string (!)
|
The severity as a string (!)
|
||||||
"""
|
"""
|
||||||
# pylint: disable=method-hidden
|
|
||||||
if self._severity is None:
|
if self._severity is None:
|
||||||
return ""
|
return ""
|
||||||
else:
|
else:
|
||||||
@ -233,7 +232,6 @@ class StatusBar(QWidget):
|
|||||||
@pyqtProperty(bool)
|
@pyqtProperty(bool)
|
||||||
def prompt_active(self):
|
def prompt_active(self):
|
||||||
"""Getter for self.prompt_active, so it can be used as Qt property."""
|
"""Getter for self.prompt_active, so it can be used as Qt property."""
|
||||||
# pylint: disable=method-hidden
|
|
||||||
return self._prompt_active
|
return self._prompt_active
|
||||||
|
|
||||||
def _set_prompt_active(self, val):
|
def _set_prompt_active(self, val):
|
||||||
@ -249,7 +247,6 @@ class StatusBar(QWidget):
|
|||||||
@pyqtProperty(bool)
|
@pyqtProperty(bool)
|
||||||
def insert_active(self):
|
def insert_active(self):
|
||||||
"""Getter for self.insert_active, so it can be used as Qt property."""
|
"""Getter for self.insert_active, so it can be used as Qt property."""
|
||||||
# pylint: disable=method-hidden
|
|
||||||
return self._insert_active
|
return self._insert_active
|
||||||
|
|
||||||
def _set_insert_active(self, val):
|
def _set_insert_active(self, val):
|
||||||
|
@ -90,7 +90,6 @@ class UrlText(textbase.TextBase):
|
|||||||
Return:
|
Return:
|
||||||
The urltype as a string (!)
|
The urltype as a string (!)
|
||||||
"""
|
"""
|
||||||
# pylint: disable=method-hidden
|
|
||||||
if self._urltype is None:
|
if self._urltype is None:
|
||||||
return ""
|
return ""
|
||||||
else:
|
else:
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# pylint: disable=broad-except
|
|
||||||
|
|
||||||
"""The dialog which gets shown when qutebrowser crashes."""
|
"""The dialog which gets shown when qutebrowser crashes."""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
@ -54,7 +54,7 @@ def later(ms: {'type': int}, command, win_id: {'special': 'win_id'}):
|
|||||||
functools.partial(commandrunner.run_safely, command))
|
functools.partial(commandrunner.run_safely, command))
|
||||||
timer.timeout.connect(timer.deleteLater)
|
timer.timeout.connect(timer.deleteLater)
|
||||||
timer.start()
|
timer.start()
|
||||||
except: # pylint: disable=bare-except
|
except:
|
||||||
timer.deleteLater()
|
timer.deleteLater()
|
||||||
raise
|
raise
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ def debug_crash(typ: {'type': ('exception', 'segfault')}='exception'):
|
|||||||
# From python's Lib/test/crashers/bogus_code_obj.py
|
# From python's Lib/test/crashers/bogus_code_obj.py
|
||||||
co = types.CodeType(0, 0, 0, 0, 0, b'\x04\x71\x00\x00', (), (), (),
|
co = types.CodeType(0, 0, 0, 0, 0, b'\x04\x71\x00\x00', (), (), (),
|
||||||
'', '', 1, b'')
|
'', '', 1, b'')
|
||||||
exec(co) # pylint: disable=exec-used
|
exec(co)
|
||||||
raise Exception("Segfault failed (wat.)")
|
raise Exception("Segfault failed (wat.)")
|
||||||
else:
|
else:
|
||||||
raise Exception("Forced crash")
|
raise Exception("Forced crash")
|
||||||
|
@ -124,7 +124,7 @@ def main():
|
|||||||
WARNING: misc/crashdialog.py checks the stacktrace for this function
|
WARNING: misc/crashdialog.py checks the stacktrace for this function
|
||||||
name, so if this is changed, it should be changed there as well!
|
name, so if this is changed, it should be changed there as well!
|
||||||
"""
|
"""
|
||||||
return app.exec_() # pylint: disable=maybe-no-member
|
return app.exec_()
|
||||||
|
|
||||||
# We set qApp explicitely here to reduce the risk of segfaults while
|
# We set qApp explicitely here to reduce the risk of segfaults while
|
||||||
# quitting.
|
# quitting.
|
||||||
|
@ -69,7 +69,6 @@ class ConfigParserTests(unittest.TestCase):
|
|||||||
"""Test a transformed option with the old name."""
|
"""Test a transformed option with the old name."""
|
||||||
# WORKAROUND for unknown PyQt bug
|
# WORKAROUND for unknown PyQt bug
|
||||||
# Instance of 'str' has no 'name' member
|
# Instance of 'str' has no 'name' member
|
||||||
# pylint: disable=no-member
|
|
||||||
self.cp.read_dict({'colors': {'tab.fg.odd': 'pink'}})
|
self.cp.read_dict({'colors': {'tab.fg.odd': 'pink'}})
|
||||||
self.cfg._from_cp(self.cp)
|
self.cfg._from_cp(self.cp)
|
||||||
self.assertEqual(self.cfg.get('colors', 'tabs.fg.odd').name(),
|
self.assertEqual(self.cfg.get('colors', 'tabs.fg.odd').name(),
|
||||||
@ -79,7 +78,6 @@ class ConfigParserTests(unittest.TestCase):
|
|||||||
"""Test a transformed section with the new name."""
|
"""Test a transformed section with the new name."""
|
||||||
# WORKAROUND for unknown PyQt bug
|
# WORKAROUND for unknown PyQt bug
|
||||||
# Instance of 'str' has no 'name' member
|
# Instance of 'str' has no 'name' member
|
||||||
# pylint: disable=no-member
|
|
||||||
self.cp.read_dict({'colors': {'tabs.fg.odd': 'pink'}})
|
self.cp.read_dict({'colors': {'tabs.fg.odd': 'pink'}})
|
||||||
self.cfg._from_cp(self.cp)
|
self.cfg._from_cp(self.cp)
|
||||||
self.assertEqual(self.cfg.get('colors', 'tabs.fg.odd').name(),
|
self.assertEqual(self.cfg.get('colors', 'tabs.fg.odd').name(),
|
||||||
|
@ -210,8 +210,6 @@ class ErrorMessageTests(unittest.TestCase):
|
|||||||
editor: The ExternalEditor instance to test.
|
editor: The ExternalEditor instance to test.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# pylint: disable=maybe-no-member
|
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.editor = editor.ExternalEditor(0)
|
self.editor = editor.ExternalEditor(0)
|
||||||
|
|
||||||
|
@ -43,7 +43,8 @@ class JinjaTests(unittest.TestCase):
|
|||||||
"""Test with a simple template."""
|
"""Test with a simple template."""
|
||||||
readfile_mock.side_effect = _read_file
|
readfile_mock.side_effect = _read_file
|
||||||
template = jinja.env.get_template('test.html')
|
template = jinja.env.get_template('test.html')
|
||||||
data = template.render(var='World') # pylint: disable=maybe-no-member
|
# https://bitbucket.org/logilab/pylint/issue/490/
|
||||||
|
data = template.render(var='World') # pylint: disable=no-member
|
||||||
self.assertEqual(data, "Hello World")
|
self.assertEqual(data, "Hello World")
|
||||||
|
|
||||||
def test_utf8(self, readfile_mock):
|
def test_utf8(self, readfile_mock):
|
||||||
@ -56,7 +57,8 @@ class JinjaTests(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
readfile_mock.side_effect = _read_file
|
readfile_mock.side_effect = _read_file
|
||||||
template = jinja.env.get_template('test.html')
|
template = jinja.env.get_template('test.html')
|
||||||
data = template.render(var='\u2603') # pylint: disable=maybe-no-member
|
# https://bitbucket.org/logilab/pylint/issue/490/
|
||||||
|
data = template.render(var='\u2603') # pylint: disable=no-member
|
||||||
self.assertEqual(data, "Hello \u2603")
|
self.assertEqual(data, "Hello \u2603")
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,12 +32,10 @@ from PyQt5.QtCore import (QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg,
|
|||||||
qInstallMessageHandler)
|
qInstallMessageHandler)
|
||||||
# Optional imports
|
# Optional imports
|
||||||
try:
|
try:
|
||||||
# pylint: disable=import-error
|
|
||||||
import colorama
|
import colorama
|
||||||
except ImportError:
|
except ImportError:
|
||||||
colorama = None
|
colorama = None
|
||||||
try:
|
try:
|
||||||
# pylint: disable=import-error
|
|
||||||
import colorlog
|
import colorlog
|
||||||
except ImportError:
|
except ImportError:
|
||||||
colorlog = None
|
colorlog = None
|
||||||
|
@ -183,7 +183,7 @@ def savefile_open(filename, binary=False, encoding='utf-8'):
|
|||||||
new_f = None
|
new_f = None
|
||||||
try:
|
try:
|
||||||
ok = f.open(QIODevice.WriteOnly)
|
ok = f.open(QIODevice.WriteOnly)
|
||||||
if not ok: # pylint: disable=used-before-assignment
|
if not ok:
|
||||||
raise OSError(f.errorString())
|
raise OSError(f.errorString())
|
||||||
if binary:
|
if binary:
|
||||||
new_f = PyQIODevice(f)
|
new_f = PyQIODevice(f)
|
||||||
@ -196,8 +196,8 @@ def savefile_open(filename, binary=False, encoding='utf-8'):
|
|||||||
finally:
|
finally:
|
||||||
if new_f is not None:
|
if new_f is not None:
|
||||||
new_f.flush()
|
new_f.flush()
|
||||||
ok = f.commit()
|
commit_ok = f.commit()
|
||||||
if not ok:
|
if not commit_ok:
|
||||||
raise OSError(f.errorString())
|
raise OSError(f.errorString())
|
||||||
|
|
||||||
|
|
||||||
|
@ -171,8 +171,6 @@ def _os_info():
|
|||||||
Return:
|
Return:
|
||||||
A list of lines with version info.
|
A list of lines with version info.
|
||||||
"""
|
"""
|
||||||
# pylint has issues with platform.mac_ver()
|
|
||||||
# pylint: disable=unpacking-non-sequence
|
|
||||||
lines = []
|
lines = []
|
||||||
releaseinfo = None
|
releaseinfo = None
|
||||||
if sys.platform == 'linux':
|
if sys.platform == 'linux':
|
||||||
@ -181,6 +179,8 @@ def _os_info():
|
|||||||
elif sys.platform == 'win32':
|
elif sys.platform == 'win32':
|
||||||
osver = ', '.join(platform.win32_ver())
|
osver = ', '.join(platform.win32_ver())
|
||||||
elif sys.platform == 'darwin':
|
elif sys.platform == 'darwin':
|
||||||
|
# pylint: disable=unpacking-non-sequence
|
||||||
|
# See https://bitbucket.org/logilab/pylint/issue/165/
|
||||||
release, versioninfo, machine = platform.mac_ver()
|
release, versioninfo, machine = platform.mac_ver()
|
||||||
if all(not e for e in versioninfo):
|
if all(not e for e in versioninfo):
|
||||||
versioninfo = ''
|
versioninfo = ''
|
||||||
|
@ -18,8 +18,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# pylint: disable=broad-except
|
|
||||||
|
|
||||||
"""Check by which hostblock list a host was blocked."""
|
"""Check by which hostblock list a host was blocked."""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
@ -18,8 +18,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# pylint: disable=broad-except
|
|
||||||
|
|
||||||
""" Run different codecheckers over a codebase.
|
""" Run different codecheckers over a codebase.
|
||||||
|
|
||||||
Runs flake8, pylint, pep257, a CRLF/whitespace/conflict-checker and
|
Runs flake8, pylint, pep257, a CRLF/whitespace/conflict-checker and
|
||||||
@ -81,7 +79,6 @@ def run(name, target=None, print_version=False):
|
|||||||
target: The package to check
|
target: The package to check
|
||||||
print_version: Whether to print the checker version.
|
print_version: Whether to print the checker version.
|
||||||
"""
|
"""
|
||||||
# pylint: disable=too-many-branches
|
|
||||||
args = _get_args(name)
|
args = _get_args(name)
|
||||||
if target is not None:
|
if target is not None:
|
||||||
args.append(target)
|
args.append(target)
|
||||||
@ -112,7 +109,6 @@ def check_pep257(target, print_version=False):
|
|||||||
We use this rather than run() because on some systems (e.g. Windows) no
|
We use this rather than run() because on some systems (e.g. Windows) no
|
||||||
pep257 binary is available.
|
pep257 binary is available.
|
||||||
"""
|
"""
|
||||||
# pylint: disable=assignment-from-no-return,no-member
|
|
||||||
if print_version:
|
if print_version:
|
||||||
print(pep257.__version__)
|
print(pep257.__version__)
|
||||||
args = _get_args('pep257')
|
args = _get_args('pep257')
|
||||||
@ -120,6 +116,7 @@ def check_pep257(target, print_version=False):
|
|||||||
if args is not None:
|
if args is not None:
|
||||||
sys.argv += args
|
sys.argv += args
|
||||||
try:
|
try:
|
||||||
|
# pylint: disable=assignment-from-no-return,no-member
|
||||||
if hasattr(pep257, 'run_pep257'):
|
if hasattr(pep257, 'run_pep257'):
|
||||||
# newer pep257 versions
|
# newer pep257 versions
|
||||||
status = pep257.run_pep257()
|
status = pep257.run_pep257()
|
||||||
@ -219,6 +216,8 @@ def check_vcs_conflict(target):
|
|||||||
|
|
||||||
def _get_optional_args(checker):
|
def _get_optional_args(checker):
|
||||||
"""Get a list of arguments based on a comma-separated args config."""
|
"""Get a list of arguments based on a comma-separated args config."""
|
||||||
|
# pylint: disable=no-member
|
||||||
|
# https://bitbucket.org/logilab/pylint/issue/487/
|
||||||
try:
|
try:
|
||||||
return config.get(checker, 'args').split(',')
|
return config.get(checker, 'args').split(',')
|
||||||
except configparser.NoOptionError:
|
except configparser.NoOptionError:
|
||||||
@ -239,6 +238,8 @@ def _get_args(checker):
|
|||||||
Return:
|
Return:
|
||||||
A list of commandline arguments.
|
A list of commandline arguments.
|
||||||
"""
|
"""
|
||||||
|
# pylint: disable=no-member
|
||||||
|
# https://bitbucket.org/logilab/pylint/issue/487/
|
||||||
args = []
|
args = []
|
||||||
if checker == 'pylint':
|
if checker == 'pylint':
|
||||||
args += _get_flag('disable', 'pylint', 'disable')
|
args += _get_flag('disable', 'pylint', 'disable')
|
||||||
@ -275,6 +276,8 @@ def _get_args(checker):
|
|||||||
|
|
||||||
def _get_checkers(args):
|
def _get_checkers(args):
|
||||||
"""Get a dict of checkers we need to execute."""
|
"""Get a dict of checkers we need to execute."""
|
||||||
|
# pylint: disable=no-member
|
||||||
|
# https://bitbucket.org/logilab/pylint/issue/487/
|
||||||
# "Static" checkers
|
# "Static" checkers
|
||||||
checkers = collections.OrderedDict([
|
checkers = collections.OrderedDict([
|
||||||
('global', collections.OrderedDict([
|
('global', collections.OrderedDict([
|
||||||
@ -303,6 +306,8 @@ def _get_checkers(args):
|
|||||||
|
|
||||||
def _checker_enabled(args, group, name):
|
def _checker_enabled(args, group, name):
|
||||||
"""Check if a named checker is enabled."""
|
"""Check if a named checker is enabled."""
|
||||||
|
# pylint: disable=no-member
|
||||||
|
# https://bitbucket.org/logilab/pylint/issue/487/
|
||||||
if args.checkers == 'all':
|
if args.checkers == 'all':
|
||||||
if not args.setup and group == 'setup':
|
if not args.setup and group == 'setup':
|
||||||
return False
|
return False
|
||||||
@ -333,6 +338,8 @@ def _parse_args():
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main entry point."""
|
"""Main entry point."""
|
||||||
|
# pylint: disable=no-member
|
||||||
|
# https://bitbucket.org/logilab/pylint/issue/487/
|
||||||
utils.change_cwd()
|
utils.change_cwd()
|
||||||
read_files = config.read('.run_checks')
|
read_files = config.read('.run_checks')
|
||||||
if not read_files:
|
if not read_files:
|
||||||
|
@ -367,7 +367,7 @@ def _format_block(filename, what, data):
|
|||||||
elif not found_end:
|
elif not found_end:
|
||||||
raise Exception("Marker '// QUTE_{}_END' not found in "
|
raise Exception("Marker '// QUTE_{}_END' not found in "
|
||||||
"'{}'!".format(what, filename))
|
"'{}'!".format(what, filename))
|
||||||
except: # pylint: disable=bare-except
|
except:
|
||||||
os.remove(tmpname)
|
os.remove(tmpname)
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user