Skip to content

Commit

Permalink
chore: replace black with ruff formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
kiendang committed Oct 25, 2023
1 parent 75a1d7d commit b345693
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 12 deletions.
7 changes: 2 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@ repos:
rev: "0.49"
hooks:
- id: check-manifest
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.0
rev: v0.1.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
- id: ruff-format
1 change: 0 additions & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ target-version = "py38"

[isort]
known-first-party = ["graphql_server"]
force-wrap-aliases = true
combine-as-imports = true

[pyupgrade]
Expand Down
2 changes: 1 addition & 1 deletion tests/aiohttp/test_graphiqlview.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def test_graphiql_is_enabled(app, client):
' "test": "Hello World"\n'
" }\n"
"}".replace('"', '\\"').replace("\n", "\\n")
)
) # fmt: skip

assert pretty_response in await response.text()

Expand Down
2 changes: 1 addition & 1 deletion tests/flask/test_graphiqlview.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_graphiql_renders_pretty(app, client):
' "test": "Hello World"\n'
" }\n"
"}".replace('"', '\\"').replace("\n", "\\n")
)
) # fmt: skip

assert pretty_response in response.data.decode("utf-8")

Expand Down
4 changes: 2 additions & 2 deletions tests/quart/test_graphiqlview.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async def execute_client(
client: TestClientProtocol,
method: str = "GET",
headers: Optional[Headers] = None,
**extra_params
**extra_params,
) -> Response:
test_request_context = app.test_request_context(path="/", method=method)
async with test_request_context:
Expand Down Expand Up @@ -51,7 +51,7 @@ async def test_graphiql_renders_pretty(app: Quart, client: TestClientProtocol):
' "test": "Hello World"\n'
" }\n"
"}".replace('"', '\\"').replace("\n", "\\n")
)
) # fmt: skip
result = await response.get_data(as_text=True)
assert pretty_response in result

Expand Down
2 changes: 1 addition & 1 deletion tests/sanic/test_graphiqlview.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_graphiql_is_enabled(app):
' "test": "Hello World"\n'
" }\n"
"}".replace('"', '\\"').replace("\n", "\\n")
)
) # fmt: skip

assert pretty_response in response.body.decode("utf-8")

Expand Down
2 changes: 1 addition & 1 deletion tests/webob/test_graphiqlview.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_graphiql_simple_renderer(client):
' "test": "Hello World"\n'
" }\n"
"}".replace('"', '\\"').replace("\n", "\\n")
)
) # fmt: skip
assert pretty_response in response.body.decode("utf-8")


Expand Down

0 comments on commit b345693

Please sign in to comment.