mirror of
				https://github.com/graphql-python/graphene-django.git
				synced 2025-11-04 09:57:53 +03:00 
			
		
		
		
	Update ruff
This commit is contained in:
		
							parent
							
								
									2eba112c28
								
							
						
					
					
						commit
						f869eca340
					
				| 
						 | 
				
			
			@ -20,7 +20,7 @@ repos:
 | 
			
		|||
    hooks:
 | 
			
		||||
    -   id: black
 | 
			
		||||
-   repo: https://github.com/astral-sh/ruff-pre-commit
 | 
			
		||||
    rev: v0.0.282
 | 
			
		||||
    rev: v0.0.283
 | 
			
		||||
    hooks:
 | 
			
		||||
    -   id: ruff
 | 
			
		||||
        args: [--fix, --exit-non-zero-on-fix, --show-fixes]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,8 +27,8 @@ def get_form_field_description(field):
 | 
			
		|||
@singledispatch
 | 
			
		||||
def convert_form_field(field):
 | 
			
		||||
    raise ImproperlyConfigured(
 | 
			
		||||
        "Don't know how to convert the Django form field {} ({}) "
 | 
			
		||||
        "to Graphene type".format(field, field.__class__)
 | 
			
		||||
        f"Don't know how to convert the Django form field {field} ({field.__class__}) "
 | 
			
		||||
        "to Graphene type"
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,8 +13,8 @@ from .types import DictType
 | 
			
		|||
@singledispatch
 | 
			
		||||
def get_graphene_type_from_serializer_field(field):
 | 
			
		||||
    raise ImproperlyConfigured(
 | 
			
		||||
        "Don't know how to convert the serializer field {} ({}) "
 | 
			
		||||
        "to Graphene type".format(field, field.__class__)
 | 
			
		||||
        f"Don't know how to convert the serializer field {field} ({field.__class__}) "
 | 
			
		||||
        "to Graphene type"
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -160,9 +160,9 @@ class DjangoObjectType(ObjectType):
 | 
			
		|||
            registry = get_global_registry()
 | 
			
		||||
 | 
			
		||||
        assert isinstance(registry, Registry), (
 | 
			
		||||
            "The attribute registry in {} needs to be an instance of "
 | 
			
		||||
            'Registry, received "{}".'
 | 
			
		||||
        ).format(cls.__name__, registry)
 | 
			
		||||
            f"The attribute registry in {cls.__name__} needs to be an instance of "
 | 
			
		||||
            f'Registry, received "{registry}".'
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        if filter_fields and filterset_class:
 | 
			
		||||
            raise Exception("Can't set both filter_fields and filterset_class")
 | 
			
		||||
| 
						 | 
				
			
			@ -175,7 +175,7 @@ class DjangoObjectType(ObjectType):
 | 
			
		|||
 | 
			
		||||
        assert not (fields and exclude), (
 | 
			
		||||
            "Cannot set both 'fields' and 'exclude' options on "
 | 
			
		||||
            "DjangoObjectType {class_name}.".format(class_name=cls.__name__)
 | 
			
		||||
            f"DjangoObjectType {cls.__name__}."
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        # Alias only_fields -> fields
 | 
			
		||||
| 
						 | 
				
			
			@ -214,8 +214,8 @@ class DjangoObjectType(ObjectType):
 | 
			
		|||
            warnings.warn(
 | 
			
		||||
                "Creating a DjangoObjectType without either the `fields` "
 | 
			
		||||
                "or the `exclude` option is deprecated. Add an explicit `fields "
 | 
			
		||||
                "= '__all__'` option on DjangoObjectType {class_name} to use all "
 | 
			
		||||
                "fields".format(class_name=cls.__name__),
 | 
			
		||||
                f"= '__all__'` option on DjangoObjectType {cls.__name__} to use all "
 | 
			
		||||
                "fields",
 | 
			
		||||
                DeprecationWarning,
 | 
			
		||||
                stacklevel=2,
 | 
			
		||||
            )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user