Tweak linter to ignore less issues

This commit is contained in:
Hugo Osvaldo Barrera 2021-06-12 12:58:13 +02:00
parent 9d3ef030fa
commit 320ac6020b
3 changed files with 11 additions and 12 deletions

View file

@ -11,12 +11,12 @@ addopts =
--no-cov-on-fail --no-cov-on-fail
[flake8] [flake8]
# E731: Use a def instead of lambda expr application-import-names = tests,vdirsyncer
# E743: Ambiguous function definition extend-ignore =
ignore = E731, E743 E203, # Black-incompatible colon spacing.
# E503: Line break occurred before a binary operator W503, # Line jump before binary operator.
extend-ignore = E203, W503 I100,
I202
max-line-length = 88 max-line-length = 88
select = C,E,F,W,B,B9 exclude = .eggs,build
exclude = .eggs, tests/storage/servers/owncloud/, tests/storage/servers/nextcloud/, tests/storage/servers/baikal/, build/ import-order-style = smarkets
application-package-names = tests,vdirsyncer

View file

@ -42,8 +42,7 @@ class GoogleSession(dav.DAVSession):
token_file = expand_path(token_file) token_file = expand_path(token_file)
ui_worker = get_ui_worker() ui_worker = get_ui_worker()
f = lambda: self._init_token(token_file, client_id, client_secret) ui_worker.put(lambda: self._init_token(token_file, client_id, client_secret))
ui_worker.put(f)
def _init_token(self, token_file, client_id, client_secret): def _init_token(self, token_file, client_id, client_secret):
token = None token = None

View file

@ -127,9 +127,9 @@ def sync(
raise BothReadOnly() raise BothReadOnly()
if conflict_resolution == "a wins": if conflict_resolution == "a wins":
conflict_resolution = lambda a, b: a conflict_resolution = lambda a, b: a # noqa: E731
elif conflict_resolution == "b wins": elif conflict_resolution == "b wins":
conflict_resolution = lambda a, b: b conflict_resolution = lambda a, b: b # noqa: E731
status_nonempty = bool(next(status.iter_old(), None)) status_nonempty = bool(next(status.iter_old(), None))