Skip to content

chore: replace black with ruff formatter #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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