mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-25 11:03:58 +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:
|
||||
- repo: git://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v1.3.0
|
||||
rev: v2.1.0
|
||||
hooks:
|
||||
- id: check-merge-conflict
|
||||
- id: check-json
|
||||
- id: check-yaml
|
||||
- id: debug-statements
|
||||
- id: end-of-file-fixer
|
||||
exclude: ^docs/.*$
|
||||
- id: trailing-whitespace
|
||||
exclude: README.md
|
||||
- id: pretty-format-json
|
||||
args:
|
||||
- --autofix
|
||||
- id: flake8
|
||||
- id: trailing-whitespace
|
||||
exclude: README.md
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v1.4.0
|
||||
rev: v1.12.0
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
- repo: https://github.com/ambv/black
|
||||
rev: 18.6b4
|
||||
rev: 18.9b0
|
||||
hooks:
|
||||
- id: black
|
||||
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:
|
||||
|
||||
```python
|
||||
class MyGrapheneMiddleware(object):
|
||||
class MyGrapheneMiddleware(object):
|
||||
def resolve(self, next_mw, root, args, context, info):
|
||||
|
||||
## Middleware code
|
||||
|
@ -287,7 +287,7 @@ class MyGrapheneMiddleware(object):
|
|||
With 2.0:
|
||||
|
||||
```python
|
||||
class MyGrapheneMiddleware(object):
|
||||
class MyGrapheneMiddleware(object):
|
||||
def resolve(self, next_mw, root, info, **args):
|
||||
context = info.context
|
||||
|
||||
|
|
|
@ -707,7 +707,10 @@ class Signature(object):
|
|||
break
|
||||
elif param.name in kwargs:
|
||||
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)
|
||||
raise TypeError(msg)
|
||||
parameters_ex = (param,)
|
||||
|
|
|
@ -75,9 +75,7 @@ def to_arguments(args, extra_args=None):
|
|||
arg_name = default_name or arg.name
|
||||
assert (
|
||||
arg_name not in arguments
|
||||
), 'More than one Argument have same name "{}".'.format(
|
||||
arg_name
|
||||
)
|
||||
), 'More than one Argument have same name "{}".'.format(arg_name)
|
||||
arguments[arg_name] = arg
|
||||
|
||||
return arguments
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
from ..utils.subclass_with_meta import SubclassWithMeta
|
||||
from ..utils.trim_docstring import trim_docstring
|
||||
import six
|
||||
|
||||
if six.PY3:
|
||||
from typing import Type
|
||||
|
||||
|
||||
class BaseOptions(object):
|
||||
|
|
|
@ -4,6 +4,9 @@ from graphql.language.ast import BooleanValue, FloatValue, IntValue, StringValue
|
|||
from .base import BaseOptions, BaseType
|
||||
from .unmountedtype import UnmountedType
|
||||
|
||||
if six.PY3:
|
||||
from typing import Any
|
||||
|
||||
|
||||
class ScalarOptions(BaseOptions):
|
||||
pass
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
from ..argument import Argument
|
||||
from ..enum import Enum
|
||||
from ..field import Field
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
from ..argument import Argument
|
||||
from ..field import Field
|
||||
from ..inputfield import InputField
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
from ..json import JSONString
|
||||
from ..objecttype import ObjectType
|
||||
from ..schema import Schema
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
from ..field import Field
|
||||
from ..scalars import String
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
from ..resolver import (
|
||||
attr_resolver,
|
||||
dict_resolver,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
from ..scalars import Scalar
|
||||
|
||||
|
||||
|
|
|
@ -18,4 +18,4 @@ def to_snake_case(name):
|
|||
|
||||
|
||||
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