flake8: Add flake8-putty plugin.
Apply a bit of putty to flake8. https://pypi.python.org/pypi/flake8-putty/
This commit is contained in:
parent
fccde768ed
commit
58fb2826ee
@ -30,7 +30,8 @@ class FixedDataNetworkReply(QNetworkReply):
|
||||
|
||||
"""QNetworkReply subclass for fixed data."""
|
||||
|
||||
def __init__(self, request, fileData, mimeType, parent=None): # noqa
|
||||
def __init__(self, request, fileData, mimeType, # flake8: disable=N803
|
||||
parent=None):
|
||||
"""Constructor.
|
||||
|
||||
Args:
|
||||
|
@ -91,7 +91,7 @@ def check_exclusive(flags, names):
|
||||
argstr))
|
||||
|
||||
|
||||
class register: # noqa # pylint: disable=invalid-name
|
||||
class register: # pylint: disable=invalid-name
|
||||
|
||||
"""Decorator to register a new command handler.
|
||||
|
||||
|
@ -46,7 +46,7 @@ from qutebrowser.utils.usertypes import Completion
|
||||
UNSET = object()
|
||||
|
||||
|
||||
class change_filter: # noqa # pylint: disable=invalid-name
|
||||
class change_filter: # pylint: disable=invalid-name
|
||||
|
||||
"""Decorator to filter calls based on a config section/option matching.
|
||||
|
||||
|
@ -65,7 +65,7 @@ class NotInModeError(Exception):
|
||||
|
||||
def init(win_id, parent):
|
||||
"""Initialize the mode manager and the keyparsers for the given win_id."""
|
||||
KM = usertypes.KeyMode # noqa # pylint: disable=invalid-name
|
||||
KM = usertypes.KeyMode # pylint: disable=invalid-name
|
||||
modeman = ModeManager(win_id, parent)
|
||||
objreg.register('mode-manager', modeman, scope='window', window=win_id)
|
||||
keyparsers = {
|
||||
|
@ -22,7 +22,7 @@
|
||||
import os
|
||||
import sys
|
||||
import bdb
|
||||
import pdb # noqa
|
||||
import pdb # flake8: disable=T002
|
||||
import signal
|
||||
import functools
|
||||
import faulthandler
|
||||
|
@ -55,7 +55,7 @@ class ShellLexer:
|
||||
self.token = ''
|
||||
self.state = ' '
|
||||
|
||||
def __iter__(self): # noqa
|
||||
def __iter__(self): # pragma: no mccabe
|
||||
"""Read a raw token from the input stream."""
|
||||
# pylint: disable=too-many-branches,too-many-statements
|
||||
self.reset()
|
||||
|
@ -224,7 +224,7 @@ def format_call(func, args=None, kwargs=None, full=True):
|
||||
return '{}({})'.format(name, format_args(args, kwargs))
|
||||
|
||||
|
||||
class log_time: # noqa pylint: disable=invalid-name
|
||||
class log_time: # pylint: disable=invalid-name
|
||||
|
||||
"""Log the time an operation takes.
|
||||
|
||||
|
@ -274,7 +274,7 @@ def qt_message_handler(msg_type, context, msg):
|
||||
# PNGs in Qt with broken color profile
|
||||
# https://bugreports.qt.io/browse/QTBUG-39788
|
||||
'libpng warning: iCCP: Not recognizing known sRGB profile that has '
|
||||
'been edited', # noqa
|
||||
'been edited', # flake8: disable=E131
|
||||
'libpng warning: iCCP: known incorrect sRGB profile',
|
||||
# Hopefully harmless warning
|
||||
'OpenType support missing for script ',
|
||||
@ -312,7 +312,7 @@ def qt_message_handler(msg_type, context, msg):
|
||||
'libpng warning: iCCP: known incorrect sRGB profile',
|
||||
# https://bugreports.qt.io/browse/QTBUG-47154
|
||||
'virtual void QSslSocketBackendPrivate::transmit() SSLRead failed '
|
||||
'with: -9805', # noqa
|
||||
'with: -9805', # flake8: disable=E131
|
||||
]
|
||||
|
||||
# Messages which will trigger an exception immediately
|
||||
|
@ -563,7 +563,7 @@ def disabled_excepthook():
|
||||
sys.excepthook = old_excepthook
|
||||
|
||||
|
||||
class prevent_exceptions: # noqa # pylint: disable=invalid-name
|
||||
class prevent_exceptions: # pylint: disable=invalid-name
|
||||
|
||||
"""Decorator to ignore and log exceptions.
|
||||
|
||||
|
@ -10,3 +10,10 @@ exclude = .venv,.hypothesis,.git,__pycache__,resources.py
|
||||
# N802: function name should be lowercase
|
||||
ignore = E128,E226,E265,E501,E402,E266,F401,N802
|
||||
max-complexity = 12
|
||||
putty-ignore =
|
||||
/# pylint: disable=invalid-name/ : +N801,N806
|
||||
/# pragma: no mccabe/ : +C901
|
||||
/# flake8: disable=E131/ : +E131
|
||||
/# flake8: disable=N803/ : +N803
|
||||
/# flake8: disable=T002/ : +T002
|
||||
/# flake8: disable=F841/ : +F841
|
||||
|
@ -247,8 +247,8 @@ class TestGetAllObjects:
|
||||
|
||||
root = QObject()
|
||||
o1 = self.Object('Object 1', root)
|
||||
o2 = self.Object('Object 2', o1) # noqa
|
||||
o3 = self.Object('Object 3', root) # noqa
|
||||
o2 = self.Object('Object 2', o1) # flake8: disable=F841
|
||||
o3 = self.Object('Object 3', root) # flake8: disable=F841
|
||||
|
||||
expected = textwrap.dedent("""
|
||||
Qt widgets - 2 objects:
|
||||
|
@ -44,7 +44,7 @@ def test_name(enum):
|
||||
def test_unknown(enum):
|
||||
"""Test invalid values which should raise an AttributeError."""
|
||||
with pytest.raises(AttributeError):
|
||||
_ = enum.three # noqa
|
||||
_ = enum.three # flake8: disable=F841
|
||||
|
||||
|
||||
def test_start():
|
||||
|
Loading…
Reference in New Issue
Block a user