Add flake8-bugbear

This commit is contained in:
Florian Bruhin 2017-11-26 21:49:37 +01:00
parent 248a12a8b9
commit 75a8938e83
5 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,7 @@
[flake8]
exclude = .*,__pycache__,resources.py
# B001: bare except
# B305: .next() (false-positives)
# E128: continuation line under-indented for visual indent
# E226: missing whitespace around arithmetic operator
# E265: Block comment should start with '#'
@ -31,6 +33,7 @@ exclude = .*,__pycache__,resources.py
# D413: Missing blank line after last section (not in pep257?)
# A003: Builtin name for class attribute (needed for attrs)
ignore =
B001,B305,
E128,E226,E265,E501,E402,E266,E722,E731,
F401,
N802,

View File

@ -1,6 +1,8 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
attrs==17.3.0
flake8==3.5.0
flake8-bugbear==17.4.0
flake8-builtins==1.0
flake8-comprehensions==1.4.1
flake8-copyright==0.2.0

View File

@ -1,4 +1,5 @@
flake8
flake8-bugbear
flake8-builtins
flake8-comprehensions
flake8-copyright

View File

@ -103,7 +103,7 @@ def whitelist_generator(): # noqa
for attr in ['visit_call', 'process_module']:
yield 'scripts.dev.pylint_checkers.modeline.' + attr
for name, member in inspect.getmembers(configtypes, inspect.isclass):
for name, _member in inspect.getmembers(configtypes, inspect.isclass):
yield 'qutebrowser.config.configtypes.' + name
yield 'qutebrowser.config.configexc.ConfigErrorDesc.traceback'
yield 'qutebrowser.config.configfiles.ConfigAPI.load_autoconfig'

View File

@ -45,7 +45,7 @@ def completionview(qtbot, status_command_stub, config_stub, win_registry,
def test_set_model(completionview):
"""Ensure set_model actually sets the model and expands all categories."""
model = completionmodel.CompletionModel()
for i in range(3):
for _i in range(3):
model.add_category(listcategory.ListCategory('', [('foo',)]))
completionview.set_model(model)
assert completionview.model() is model