mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Add flake8-bugbear
This commit is contained in:
parent
5dc6a5ff36
commit
68d2647e38
6 changed files with 6 additions and 9 deletions
2
Makefile
2
Makefile
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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/
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
|
|
@ -232,9 +232,6 @@ class SingleFileStorage(Storage):
|
|||
self._at_once = True
|
||||
try:
|
||||
yield self
|
||||
except:
|
||||
raise
|
||||
else:
|
||||
self._write()
|
||||
finally:
|
||||
self._at_once = False
|
||||
|
|
|
|||
Loading…
Reference in a new issue