From 31501354d00144c5c98a4de52899b61cb40b2f9c Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 6 Dec 2022 16:51:36 +0000 Subject: [PATCH] pre-commit: Bump plugin versions These are all rather out-of-date and not compatible with the default Python version on my system (Python 3.11). Signed-off-by: Stephen Finucane --- .pre-commit-config.yaml | 9 ++++--- .../httpdomain/test_render_request_body.py | 3 ++- .../test_render_request_body_example.py | 24 ++++++++++++++----- .../test_render_response_example.py | 8 +++++-- .../httpdomain/test_render_responses.py | 3 ++- tox.ini | 14 +++++++++++ 6 files changed, 46 insertions(+), 15 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cbe6ff1..b34adc7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.4.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -10,7 +10,7 @@ repos: - id: debug-statements - repo: https://github.com/psf/black - rev: 19.10b0 + rev: 22.10.0 hooks: - id: black args: [--line-length=88, --target-version=py35] @@ -41,8 +41,7 @@ repos: | tests/test_spec_examples.py ) - - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.9 + - repo: https://github.com/pycqa/flake8 + rev: 6.0.0 hooks: - id: flake8 - args: [--max-line-length=99] diff --git a/tests/renderers/httpdomain/test_render_request_body.py b/tests/renderers/httpdomain/test_render_request_body.py index 2794cbb..b45e9d5 100644 --- a/tests/renderers/httpdomain/test_render_request_body.py +++ b/tests/renderers/httpdomain/test_render_request_body.py @@ -79,7 +79,8 @@ def test_render_request_body_schema_description_turned_off(fakestate, oas_fragme """JSON schema description is not rendered b/c feature is off.""" testrenderer = renderers.HttpdomainRenderer( - fakestate, {"no-json-schema-description": True}, + fakestate, + {"no-json-schema-description": True}, ) markup = textify( diff --git a/tests/renderers/httpdomain/test_render_request_body_example.py b/tests/renderers/httpdomain/test_render_request_body_example.py index 40022dc..b27eaf0 100644 --- a/tests/renderers/httpdomain/test_render_request_body_example.py +++ b/tests/renderers/httpdomain/test_render_request_body_example.py @@ -122,7 +122,9 @@ def test_render_request_body_example(testrenderer, content, oas_fragment): markup = textify( testrenderer.render_request_body_example( - oas_fragment(content), "/evidences/{evidenceId}", "POST", + oas_fragment(content), + "/evidences/{evidenceId}", + "POST", ) ) assert markup == textwrap.dedent( @@ -397,7 +399,9 @@ def test_render_request_body_example_external_errored_next_example( """Request body's example fallbacks on next when external cannot be retrieved.""" responses.add( - responses.GET, "https://example.com/json/examples/test.json", status=404, + responses.GET, + "https://example.com/json/examples/test.json", + status=404, ) markup = textify( @@ -431,12 +435,16 @@ def test_render_request_body_example_external_errored_next_example( @responses.activate def test_render_request_body_example_external_errored_next_media_type( - testrenderer, oas_fragment, caplog, + testrenderer, + oas_fragment, + caplog, ): """Request body's example fallbacks on next when external cannot be retrieved.""" responses.add( - responses.GET, "https://example.com/json/examples/test.json", status=404, + responses.GET, + "https://example.com/json/examples/test.json", + status=404, ) markup = textify( @@ -524,7 +532,9 @@ def test_render_request_body_example_noop(testrenderer, oas_fragment): ["http_method"], [pytest.param("POST"), pytest.param("PUT"), pytest.param("PATCH")] ) def test_render_request_body_example_http_method( - testrenderer, oas_fragment, http_method, + testrenderer, + oas_fragment, + http_method, ): """Request body's example shows proper HTTP method.""" @@ -562,7 +572,9 @@ def test_render_request_body_example_http_method( [pytest.param("/evidences/{evidenceId}"), pytest.param("/heroes/{heroId}")], ) def test_render_request_body_example_http_endpoint( - testrenderer, oas_fragment, http_endpoint, + testrenderer, + oas_fragment, + http_endpoint, ): """Request body's example shows proper HTTP method.""" diff --git a/tests/renderers/httpdomain/test_render_response_example.py b/tests/renderers/httpdomain/test_render_response_example.py index 09e4f55..99791c5 100644 --- a/tests/renderers/httpdomain/test_render_response_example.py +++ b/tests/renderers/httpdomain/test_render_response_example.py @@ -375,7 +375,9 @@ def test_render_response_example_external_errored_next_example( """Path response's example fallbacks on next when external cannot be retrieved.""" responses.add( - responses.GET, "https://example.com/json/examples/test.json", status=404, + responses.GET, + "https://example.com/json/examples/test.json", + status=404, ) markup = textify( @@ -412,7 +414,9 @@ def test_render_response_example_external_errored_next_media_type( """Path response's example fallbacks on next when external cannot be retrieved.""" responses.add( - responses.GET, "https://example.com/json/examples/test.json", status=404, + responses.GET, + "https://example.com/json/examples/test.json", + status=404, ) markup = textify( diff --git a/tests/renderers/httpdomain/test_render_responses.py b/tests/renderers/httpdomain/test_render_responses.py index f80437d..0c72e30 100644 --- a/tests/renderers/httpdomain/test_render_responses.py +++ b/tests/renderers/httpdomain/test_render_responses.py @@ -213,7 +213,8 @@ def test_render_responses_json_schema_description_turned_off(fakestate, oas_frag """JSON schema description is not rendered b/c feature is off.""" testrenderer = renderers.HttpdomainRenderer( - fakestate, {"no-json-schema-description": True}, + fakestate, + {"no-json-schema-description": True}, ) markup = textify( diff --git a/tox.ini b/tox.ini index 1576421..938e424 100644 --- a/tox.ini +++ b/tox.ini @@ -23,3 +23,17 @@ commands = [pytest] markers = regenerate_rendered_specs + +[flake8] +# The following are ignored since they conflict with black +# +# E123 closing bracket does not match indentation of opening bracket's line +# E241 multiple spaces after ':' +# E226 missing whitespace around arithmetic operator +# W503 line break before binary operator +# +# The following are ignored since we disagree with them +# +# F541 f-string is missing placeholders +ignore = E123, E241, E226, W503, F541 +max-line-length = 99