From fccde768ed11c5e640f807dbed55d8a99325503b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 21 Jan 2016 22:16:24 +0100 Subject: [PATCH] flake8: Add pep8-naming plugin. Check PEP-8 naming conventions, plugin for flake8 https://pypi.python.org/pypi/pep8-naming/ --- qutebrowser/browser/network/networkreply.py | 2 +- qutebrowser/commands/cmdutils.py | 2 +- qutebrowser/config/config.py | 2 +- qutebrowser/keyinput/modeman.py | 2 +- qutebrowser/utils/debug.py | 2 +- qutebrowser/utils/utils.py | 2 +- setup.cfg | 3 ++- tox.ini | 1 + 8 files changed, 9 insertions(+), 7 deletions(-) diff --git a/qutebrowser/browser/network/networkreply.py b/qutebrowser/browser/network/networkreply.py index 570da54c9..71f82c39e 100644 --- a/qutebrowser/browser/network/networkreply.py +++ b/qutebrowser/browser/network/networkreply.py @@ -30,7 +30,7 @@ class FixedDataNetworkReply(QNetworkReply): """QNetworkReply subclass for fixed data.""" - def __init__(self, request, fileData, mimeType, parent=None): + def __init__(self, request, fileData, mimeType, parent=None): # noqa """Constructor. Args: diff --git a/qutebrowser/commands/cmdutils.py b/qutebrowser/commands/cmdutils.py index 45b542189..54def33a7 100644 --- a/qutebrowser/commands/cmdutils.py +++ b/qutebrowser/commands/cmdutils.py @@ -91,7 +91,7 @@ def check_exclusive(flags, names): argstr)) -class register: # pylint: disable=invalid-name +class register: # noqa # pylint: disable=invalid-name """Decorator to register a new command handler. diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index af901a29d..889887728 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -46,7 +46,7 @@ from qutebrowser.utils.usertypes import Completion UNSET = object() -class change_filter: # pylint: disable=invalid-name +class change_filter: # noqa # pylint: disable=invalid-name """Decorator to filter calls based on a config section/option matching. diff --git a/qutebrowser/keyinput/modeman.py b/qutebrowser/keyinput/modeman.py index 21c579761..c7d245c83 100644 --- a/qutebrowser/keyinput/modeman.py +++ b/qutebrowser/keyinput/modeman.py @@ -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 # pylint: disable=invalid-name + KM = usertypes.KeyMode # noqa # pylint: disable=invalid-name modeman = ModeManager(win_id, parent) objreg.register('mode-manager', modeman, scope='window', window=win_id) keyparsers = { diff --git a/qutebrowser/utils/debug.py b/qutebrowser/utils/debug.py index 09aa314e5..33b113945 100644 --- a/qutebrowser/utils/debug.py +++ b/qutebrowser/utils/debug.py @@ -224,7 +224,7 @@ def format_call(func, args=None, kwargs=None, full=True): return '{}({})'.format(name, format_args(args, kwargs)) -class log_time: # pylint: disable=invalid-name +class log_time: # noqa pylint: disable=invalid-name """Log the time an operation takes. diff --git a/qutebrowser/utils/utils.py b/qutebrowser/utils/utils.py index ecd31ae0f..ab8925fb0 100644 --- a/qutebrowser/utils/utils.py +++ b/qutebrowser/utils/utils.py @@ -563,7 +563,7 @@ def disabled_excepthook(): sys.excepthook = old_excepthook -class prevent_exceptions: # pylint: disable=invalid-name +class prevent_exceptions: # noqa # pylint: disable=invalid-name """Decorator to ignore and log exceptions. diff --git a/setup.cfg b/setup.cfg index d7bb138a2..d910dd19d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,5 +7,6 @@ exclude = .venv,.hypothesis,.git,__pycache__,resources.py # E402: module level import not at top of file # E266: too many leading '#' for block comment # F401: Unused import -ignore = E128,E226,E265,E501,E402,E266,F401 +# N802: function name should be lowercase +ignore = E128,E226,E265,E501,E402,E266,F401,N802 max-complexity = 12 diff --git a/tox.ini b/tox.ini index d20f3ceda..477da5ddc 100644 --- a/tox.ini +++ b/tox.ini @@ -154,6 +154,7 @@ deps = -r{toxinidir}/requirements.txt flake8==2.5.1 flake8-debugger==1.4.0 + pep8-naming==0.3.3 mccabe==0.3.1 pep8==1.7.0 pyflakes==1.0.0