Add flake8-bugbear

This commit is contained in:
Markus Unterwaditzer 2016-10-01 16:01:12 +02:00
parent 5dc6a5ff36
commit 68d2647e38
6 changed files with 6 additions and 9 deletions

View file

@ -40,7 +40,7 @@ test:
fi
install-style:
pip install flake8 flake8-import-order sphinx
pip install flake8 flake8-import-order flake8-bugbear sphinx
style:
flake8

View file

@ -7,4 +7,4 @@ norecursedirs = tests/storage/servers/*
[flake8]
# W503: Line break before operator
ignore = W503, E731
exclude = tests/storage/servers/*
exclude = tests/storage/servers/*, build/

View file

@ -5,7 +5,7 @@ from vdirsyncer.cli.utils import handle_cli_error
def test_handle_cli_error(capsys):
try:
raise exceptions.InvalidResponse('ayy lmao')
except:
except BaseException:
handle_cli_error()
out, err = capsys.readouterr()

View file

@ -29,7 +29,7 @@ def catch_errors(f):
def inner(*a, **kw):
try:
f(*a, **kw)
except:
except BaseException:
from .utils import handle_cli_error
handle_cli_error()
sys.exit(1)

View file

@ -61,7 +61,7 @@ def sync_collection(wq, collection, general, force_delete):
conflict_resolution=pair.conflict_resolution,
force_delete=force_delete
)
except:
except BaseException:
handle_cli_error(status_name)
raise JobFailed()
@ -127,7 +127,7 @@ def metasync_collection(wq, collection, general):
conflict_resolution=pair.options.get('conflict_resolution', None),
keys=pair.options.get('metadata', None) or ()
)
except:
except BaseException:
handle_cli_error(status_name)
raise JobFailed()

View file

@ -232,9 +232,6 @@ class SingleFileStorage(Storage):
self._at_once = True
try:
yield self
except:
raise
else:
self._write()
finally:
self._at_once = False