From f337d54aef38b75fc43a061b0f8900e636d30977 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Tue, 29 Nov 2022 16:56:02 -0600 Subject: [PATCH 1/3] Follow flake8's pre-commit repo from GitLab to GitHub --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 35d893f9..5f07772c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: hooks: - id: black args: [ '--safe' ] - - repo: https://gitlab.com/pycqa/flake8 + - repo: https://github.com/pycqa/flake8 rev: 4.0.1 hooks: - id: flake8 From 7d6f984d8222f422829c59d3a2b176bb84d3f9db Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Tue, 29 Nov 2022 16:56:38 -0600 Subject: [PATCH 2/3] Upgrade the flake8 pre-commit hook to latest --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5f07772c..2cf9a8b4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: black args: [ '--safe' ] - repo: https://github.com/pycqa/flake8 - rev: 4.0.1 + rev: 6.0.0 hooks: - id: flake8 args: [ From 8ee817a43e14cdb5762cdc47d83c34a945f11089 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Tue, 29 Nov 2022 16:58:59 -0600 Subject: [PATCH 3/3] Fix flake8 E741 errors E741: Do not use variables named 'I', 'O', or 'l' --- stac_fastapi/elasticsearch/tests/resources/test_item.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stac_fastapi/elasticsearch/tests/resources/test_item.py b/stac_fastapi/elasticsearch/tests/resources/test_item.py index fbac987b..cc0111f7 100644 --- a/stac_fastapi/elasticsearch/tests/resources/test_item.py +++ b/stac_fastapi/elasticsearch/tests/resources/test_item.py @@ -521,7 +521,7 @@ async def test_pagination_item_collection(app_client, ctx, txn_client): idx = 0 for idx in range(100): page_data = page.json() - next_link = list(filter(lambda l: l["rel"] == "next", page_data["links"])) + next_link = list(filter(lambda link: link["rel"] == "next", page_data["links"])) if not next_link: assert not page_data["features"] break @@ -556,7 +556,7 @@ async def test_pagination_post(app_client, ctx, txn_client): for _ in range(100): idx += 1 page_data = page.json() - next_link = list(filter(lambda l: l["rel"] == "next", page_data["links"])) + next_link = list(filter(lambda link: link["rel"] == "next", page_data["links"])) if not next_link: break @@ -585,7 +585,7 @@ async def test_pagination_token_idempotent(app_client, ctx, txn_client): page = await app_client.get("/search", params={"ids": ",".join(ids), "limit": 3}) page_data = page.json() - next_link = list(filter(lambda l: l["rel"] == "next", page_data["links"])) + next_link = list(filter(lambda link: link["rel"] == "next", page_data["links"])) # Confirm token is idempotent resp1 = await app_client.get(