From f74d1f26c79af75d65b20df1e16fdb99a9a64c2e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 22 Jan 2016 19:00:29 +0100 Subject: [PATCH] flake8: Add flake8-string-format plugin. string format checker, plugin for flake8 https://pypi.python.org/pypi/flake8-string-format/ --- qutebrowser/misc/savemanager.py | 4 ++-- setup.cfg | 6 +++++- tox.ini | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/qutebrowser/misc/savemanager.py b/qutebrowser/misc/savemanager.py index ec3b6b63b..c2e1fea5a 100644 --- a/qutebrowser/misc/savemanager.py +++ b/qutebrowser/misc/savemanager.py @@ -86,9 +86,9 @@ class Saveable: (not config.get(*self._config_opt)) and (not explicit) and (not force)): if not silent: - log.save.debug("Not saving {} because autosaving has been " + log.save.debug("Not saving {name} because autosaving has been " "disabled by {cfg[0]} -> {cfg[1]}.".format( - self._name, cfg=self._config_opt)) + name=self._name, cfg=self._config_opt)) return do_save = self._dirty or (self._save_on_exit and is_exit) or force if not silent: diff --git a/setup.cfg b/setup.cfg index 1414f186d..c5032b3d6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,11 +18,15 @@ exclude = .venv,.hypothesis,.git,__pycache__,resources.py # being concatenated is parenthesize # L207: pass is only necessary in non-optional suites containing no other # statements. +# P101: format string does contain unindexed parameters +# P102: docstring does contain unindexed parameters +# P103: other string does contain unindexed parameters ignore = E128,E226,E265,E501,E402,E266, F401, N802, - L101,L102,L103,L201,L202,L203,L204,L207 + L101,L102,L103,L201,L202,L203,L204,L207, + P101,P102,P103 max-complexity = 12 putty-ignore = /# pylint: disable=invalid-name/ : +N801,N806 diff --git a/tox.ini b/tox.ini index dac862ad9..304b735b7 100644 --- a/tox.ini +++ b/tox.ini @@ -161,6 +161,7 @@ deps = mccabe==0.3.1 pep8==1.7.0 pyflakes==1.0.0 + flake8-string-format==0.2.1 commands = {envpython} -m flake8