From 22a127191d6079360e93d16c55fb84d5ab1acbd8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 21 Mar 2022 22:41:09 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 21.12b0 → 22.1.0](https://github.com/psf/black/compare/21.12b0...22.1.0) - [github.com/asottile/pyupgrade: v2.31.0 → v2.31.1](https://github.com/asottile/pyupgrade/compare/v2.31.0...v2.31.1) - [github.com/pre-commit/mirrors-mypy: v0.931 → v0.941](https://github.com/pre-commit/mirrors-mypy/compare/v0.931...v0.941) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f326ac..09217e0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - id: flake8 additional_dependencies: [flake8-import-order, flake8-bugbear] - repo: https://github.com/psf/black - rev: "21.12b0" + rev: "22.1.0" hooks: - id: black - repo: https://github.com/pycqa/isort @@ -23,12 +23,12 @@ repos: - id: isort name: isort (python) - repo: https://github.com/asottile/pyupgrade - rev: v2.31.0 + rev: v2.31.1 hooks: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v0.931" + rev: "v0.941" hooks: - id: mypy files: vdirsyncer/.* From 60c3b595526870708ff88062f49218496504617d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 21 Mar 2022 22:41:53 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/system/cli/test_sync.py | 17 +++++++---------- tests/unit/cli/test_discover.py | 23 ++++++++++------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/tests/system/cli/test_sync.py b/tests/system/cli/test_sync.py index b89f79c..d69b4c2 100644 --- a/tests/system/cli/test_sync.py +++ b/tests/system/cli/test_sync.py @@ -353,16 +353,13 @@ def test_ident_conflict(tmpdir, runner): 'error: foobar: Storage "foo" contains multiple items with the ' "same UID or even content" ) in result.output - assert ( - sorted( - [ - "one.txt" in result.output, - "two.txt" in result.output, - "three.txt" in result.output, - ] - ) - == [False, True, True] - ) + assert sorted( + [ + "one.txt" in result.output, + "two.txt" in result.output, + "three.txt" in result.output, + ] + ) == [False, True, True] @pytest.mark.parametrize( diff --git a/tests/unit/cli/test_discover.py b/tests/unit/cli/test_discover.py index 393e20a..4c24a38 100644 --- a/tests/unit/cli/test_discover.py +++ b/tests/unit/cli/test_discover.py @@ -155,18 +155,15 @@ async def test_expand_collections(shortcuts, expected): async def handle_not_found(config, collection): return missing - assert ( - sorted( - await aiostream.stream.list( - expand_collections( - shortcuts, - config_a, - config_b, - get_discovered_a, - get_discovered_b, - handle_not_found, - ) + assert sorted( + await aiostream.stream.list( + expand_collections( + shortcuts, + config_a, + config_b, + get_discovered_a, + get_discovered_b, + handle_not_found, ) ) - == sorted(expected) - ) + ) == sorted(expected) From 5d58a86ba0e8ef014e3d9eb880f6c616c9e33242 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Tue, 22 Mar 2022 08:27:08 +0100 Subject: [PATCH 3/3] Avoid shadowing iterable inside for loop --- vdirsyncer/cli/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vdirsyncer/cli/__init__.py b/vdirsyncer/cli/__init__.py index 4e27bc5..703c1eb 100644 --- a/vdirsyncer/cli/__init__.py +++ b/vdirsyncer/cli/__init__.py @@ -126,10 +126,10 @@ def sync(ctx, collections, force_delete): from .tasks import prepare_pair from .tasks import sync_collection - async def main(collections): + async def main(collection_names): async with aiohttp.TCPConnector(limit_per_host=16) as conn: tasks = [] - for pair_name, collections in collections: + for pair_name, collections in collection_names: async for collection, config in prepare_pair( pair_name=pair_name, collections=collections, @@ -163,10 +163,10 @@ def metasync(ctx, collections): from .tasks import metasync_collection from .tasks import prepare_pair - async def main(collections): + async def main(collection_names): async with aiohttp.TCPConnector(limit_per_host=16) as conn: - for pair_name, collections in collections: + for pair_name, collections in collection_names: collections = prepare_pair( pair_name=pair_name, collections=collections,