mirror of
				https://github.com/graphql-python/graphene.git
				synced 2025-11-04 09:57:41 +03:00 
			
		
		
		
	Run pre-commit autoupdate to bump versions of precommit hooks, then run them on all files (#913)
This commit is contained in:
		
							parent
							
								
									fd0bd0ccd7
								
							
						
					
					
						commit
						9ae2359b87
					
				| 
						 | 
					@ -1,24 +1,28 @@
 | 
				
			||||||
repos:
 | 
					repos:
 | 
				
			||||||
-   repo: git://github.com/pre-commit/pre-commit-hooks
 | 
					-   repo: git://github.com/pre-commit/pre-commit-hooks
 | 
				
			||||||
    rev: v1.3.0
 | 
					    rev: v2.1.0
 | 
				
			||||||
    hooks:
 | 
					    hooks:
 | 
				
			||||||
 | 
					    -   id: check-merge-conflict
 | 
				
			||||||
    -   id: check-json
 | 
					    -   id: check-json
 | 
				
			||||||
    -   id: check-yaml
 | 
					    -   id: check-yaml
 | 
				
			||||||
    -   id: debug-statements
 | 
					    -   id: debug-statements
 | 
				
			||||||
    -   id: end-of-file-fixer
 | 
					    -   id: end-of-file-fixer
 | 
				
			||||||
        exclude: ^docs/.*$
 | 
					        exclude: ^docs/.*$
 | 
				
			||||||
    -   id: trailing-whitespace
 | 
					 | 
				
			||||||
        exclude: README.md
 | 
					 | 
				
			||||||
    -   id: pretty-format-json
 | 
					    -   id: pretty-format-json
 | 
				
			||||||
        args:
 | 
					        args:
 | 
				
			||||||
        - --autofix
 | 
					        - --autofix
 | 
				
			||||||
    -   id: flake8
 | 
					    -   id: trailing-whitespace
 | 
				
			||||||
 | 
					        exclude: README.md
 | 
				
			||||||
-   repo: https://github.com/asottile/pyupgrade
 | 
					-   repo: https://github.com/asottile/pyupgrade
 | 
				
			||||||
    rev: v1.4.0
 | 
					    rev: v1.12.0
 | 
				
			||||||
    hooks:
 | 
					    hooks:
 | 
				
			||||||
    -   id: pyupgrade
 | 
					    -   id: pyupgrade
 | 
				
			||||||
-   repo: https://github.com/ambv/black
 | 
					-   repo: https://github.com/ambv/black
 | 
				
			||||||
    rev: 18.6b4
 | 
					    rev: 18.9b0
 | 
				
			||||||
    hooks:
 | 
					    hooks:
 | 
				
			||||||
    - id: black
 | 
					    - id: black
 | 
				
			||||||
      language_version: python3
 | 
					      language_version: python3
 | 
				
			||||||
 | 
					-   repo: https://github.com/PyCQA/flake8
 | 
				
			||||||
 | 
					    rev: 3.7.7
 | 
				
			||||||
 | 
					    hooks:
 | 
				
			||||||
 | 
					    -   id: flake8
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -276,7 +276,7 @@ If you are using Middelwares, you need to some adjustments:
 | 
				
			||||||
Before:
 | 
					Before:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```python
 | 
					```python
 | 
				
			||||||
class MyGrapheneMiddleware(object):  
 | 
					class MyGrapheneMiddleware(object):
 | 
				
			||||||
    def resolve(self, next_mw, root, args, context, info):
 | 
					    def resolve(self, next_mw, root, args, context, info):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ## Middleware code
 | 
					        ## Middleware code
 | 
				
			||||||
| 
						 | 
					@ -287,7 +287,7 @@ class MyGrapheneMiddleware(object):
 | 
				
			||||||
With 2.0:
 | 
					With 2.0:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```python
 | 
					```python
 | 
				
			||||||
class MyGrapheneMiddleware(object):  
 | 
					class MyGrapheneMiddleware(object):
 | 
				
			||||||
    def resolve(self, next_mw, root, info, **args):
 | 
					    def resolve(self, next_mw, root, info, **args):
 | 
				
			||||||
        context = info.context
 | 
					        context = info.context
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -707,7 +707,10 @@ class Signature(object):
 | 
				
			||||||
                        break
 | 
					                        break
 | 
				
			||||||
                    elif param.name in kwargs:
 | 
					                    elif param.name in kwargs:
 | 
				
			||||||
                        if param.kind == _POSITIONAL_ONLY:
 | 
					                        if param.kind == _POSITIONAL_ONLY:
 | 
				
			||||||
                            msg = "{arg!r} parameter is positional only, " "but was passed as a keyword"
 | 
					                            msg = (
 | 
				
			||||||
 | 
					                                "{arg!r} parameter is positional only, "
 | 
				
			||||||
 | 
					                                "but was passed as a keyword"
 | 
				
			||||||
 | 
					                            )
 | 
				
			||||||
                            msg = msg.format(arg=param.name)
 | 
					                            msg = msg.format(arg=param.name)
 | 
				
			||||||
                            raise TypeError(msg)
 | 
					                            raise TypeError(msg)
 | 
				
			||||||
                        parameters_ex = (param,)
 | 
					                        parameters_ex = (param,)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -75,9 +75,7 @@ def to_arguments(args, extra_args=None):
 | 
				
			||||||
        arg_name = default_name or arg.name
 | 
					        arg_name = default_name or arg.name
 | 
				
			||||||
        assert (
 | 
					        assert (
 | 
				
			||||||
            arg_name not in arguments
 | 
					            arg_name not in arguments
 | 
				
			||||||
        ), 'More than one Argument have same name "{}".'.format(
 | 
					        ), 'More than one Argument have same name "{}".'.format(arg_name)
 | 
				
			||||||
            arg_name
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
        arguments[arg_name] = arg
 | 
					        arguments[arg_name] = arg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return arguments
 | 
					    return arguments
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,9 @@
 | 
				
			||||||
from ..utils.subclass_with_meta import SubclassWithMeta
 | 
					from ..utils.subclass_with_meta import SubclassWithMeta
 | 
				
			||||||
from ..utils.trim_docstring import trim_docstring
 | 
					from ..utils.trim_docstring import trim_docstring
 | 
				
			||||||
 | 
					import six
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if six.PY3:
 | 
				
			||||||
 | 
					    from typing import Type
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class BaseOptions(object):
 | 
					class BaseOptions(object):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,6 +4,9 @@ from graphql.language.ast import BooleanValue, FloatValue, IntValue, StringValue
 | 
				
			||||||
from .base import BaseOptions, BaseType
 | 
					from .base import BaseOptions, BaseType
 | 
				
			||||||
from .unmountedtype import UnmountedType
 | 
					from .unmountedtype import UnmountedType
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if six.PY3:
 | 
				
			||||||
 | 
					    from typing import Any
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ScalarOptions(BaseOptions):
 | 
					class ScalarOptions(BaseOptions):
 | 
				
			||||||
    pass
 | 
					    pass
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,3 @@
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from ..argument import Argument
 | 
					from ..argument import Argument
 | 
				
			||||||
from ..enum import Enum
 | 
					from ..enum import Enum
 | 
				
			||||||
from ..field import Field
 | 
					from ..field import Field
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,3 @@
 | 
				
			||||||
 | 
					 | 
				
			||||||
from ..argument import Argument
 | 
					from ..argument import Argument
 | 
				
			||||||
from ..field import Field
 | 
					from ..field import Field
 | 
				
			||||||
from ..inputfield import InputField
 | 
					from ..inputfield import InputField
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,3 @@
 | 
				
			||||||
 | 
					 | 
				
			||||||
from ..json import JSONString
 | 
					from ..json import JSONString
 | 
				
			||||||
from ..objecttype import ObjectType
 | 
					from ..objecttype import ObjectType
 | 
				
			||||||
from ..schema import Schema
 | 
					from ..schema import Schema
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,3 @@
 | 
				
			||||||
 | 
					 | 
				
			||||||
from ..field import Field
 | 
					from ..field import Field
 | 
				
			||||||
from ..scalars import String
 | 
					from ..scalars import String
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,3 @@
 | 
				
			||||||
 | 
					 | 
				
			||||||
from ..resolver import (
 | 
					from ..resolver import (
 | 
				
			||||||
    attr_resolver,
 | 
					    attr_resolver,
 | 
				
			||||||
    dict_resolver,
 | 
					    dict_resolver,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,3 @@
 | 
				
			||||||
 | 
					 | 
				
			||||||
from ..scalars import Scalar
 | 
					from ..scalars import Scalar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,4 +18,4 @@ def to_snake_case(name):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def to_const(string):
 | 
					def to_const(string):
 | 
				
			||||||
    return re.sub("[\W|^]+", "_", string).upper()  # noqa
 | 
					    return re.sub(r"[\W|^]+", "_", string).upper()  # noqa
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user