CI: format check using Ruff

This commit is contained in:
Dulmandakh 2024-06-23 22:09:30 +08:00
parent d90d65cafe
commit 6967ce258f
8 changed files with 6 additions and 14 deletions

View File

@ -15,7 +15,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
pip install ruff tox
- name: Format check using Ruff
run: ruff format --check
- name: Run lint
run: tox
env:

View File

@ -8,7 +8,6 @@ class Patron(graphene.ObjectType):
class Query(graphene.ObjectType):
patron = graphene.Field(Patron)
def resolve_patron(root, info):

View File

@ -27,9 +27,7 @@ snapshots["test_correctly_refetches_xwing 1"] = {
"data": {"node": {"id": "U2hpcDox", "name": "X-Wing"}}
}
snapshots[
"test_str_schema 1"
] = '''type Query {
snapshots["test_str_schema 1"] = '''type Query {
rebels: Faction
empire: Faction
node(

View File

@ -8,7 +8,6 @@ from ..node import Node, is_node
class SharedNodeFields:
shared = String()
something_else = String()

View File

@ -61,9 +61,7 @@ class EnumMeta(SubclassWithMeta_Meta):
def __iter__(cls):
return cls._meta.enum.__iter__()
def from_enum(
cls, enum, name=None, description=None, deprecation_reason=None
): # noqa: N805
def from_enum(cls, enum, name=None, description=None, deprecation_reason=None): # noqa: N805
name = name or enum.__name__
description = description or enum.__doc__ or "An enumeration."
meta_dict = {

View File

@ -39,7 +39,7 @@ def test_serializes_output_string():
assert String.serialize(-1.1) == "-1.1"
assert String.serialize(True) == "true"
assert String.serialize(False) == "false"
assert String.serialize("\U0001F601") == "\U0001F601"
assert String.serialize("\U0001f601") == "\U0001f601"
def test_serializes_output_boolean():

View File

@ -33,7 +33,6 @@ class DataLoader(object):
cache_map=None,
loop=None,
):
self._loop = loop
if batch_load_fn is not None:

View File

@ -17,7 +17,6 @@ def deprecated(reason):
"""
if isinstance(reason, string_types):
# The @deprecated is used with a 'reason'.
#
# .. code-block:: python
@ -27,7 +26,6 @@ def deprecated(reason):
# pass
def decorator(func1):
if inspect.isclass(func1):
fmt1 = f"Call to deprecated class {func1.__name__} ({reason})."
else:
@ -43,7 +41,6 @@ def deprecated(reason):
return decorator
elif inspect.isclass(reason) or inspect.isfunction(reason):
# The @deprecated is used without any 'reason'.
#
# .. code-block:: python