Skip to content

Commit 9ae2359

Browse files
dan98765ekampf
authored andcommitted
Run pre-commit autoupdate to bump versions of precommit hooks, then run them on all files (#913)
1 parent fd0bd0c commit 9ae2359

13 files changed

+25
-20
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
repos:
22
- repo: git://github.com/pre-commit/pre-commit-hooks
3-
rev: v1.3.0
3+
rev: v2.1.0
44
hooks:
5+
- id: check-merge-conflict
56
- id: check-json
67
- id: check-yaml
78
- id: debug-statements
89
- id: end-of-file-fixer
910
exclude: ^docs/.*$
10-
- id: trailing-whitespace
11-
exclude: README.md
1211
- id: pretty-format-json
1312
args:
1413
- --autofix
15-
- id: flake8
14+
- id: trailing-whitespace
15+
exclude: README.md
1616
- repo: https://github.com/asottile/pyupgrade
17-
rev: v1.4.0
17+
rev: v1.12.0
1818
hooks:
1919
- id: pyupgrade
2020
- repo: https://github.com/ambv/black
21-
rev: 18.6b4
21+
rev: 18.9b0
2222
hooks:
2323
- id: black
2424
language_version: python3
25+
- repo: https://github.com/PyCQA/flake8
26+
rev: 3.7.7
27+
hooks:
28+
- id: flake8

UPGRADE-v2.0.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ If you are using Middelwares, you need to some adjustments:
276276
Before:
277277

278278
```python
279-
class MyGrapheneMiddleware(object):
279+
class MyGrapheneMiddleware(object):
280280
def resolve(self, next_mw, root, args, context, info):
281281

282282
## Middleware code
@@ -287,7 +287,7 @@ class MyGrapheneMiddleware(object):
287287
With 2.0:
288288

289289
```python
290-
class MyGrapheneMiddleware(object):
290+
class MyGrapheneMiddleware(object):
291291
def resolve(self, next_mw, root, info, **args):
292292
context = info.context
293293

graphene/pyutils/signature.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,10 @@ def _bind(self, args, kwargs, partial=False):
707707
break
708708
elif param.name in kwargs:
709709
if param.kind == _POSITIONAL_ONLY:
710-
msg = "{arg!r} parameter is positional only, " "but was passed as a keyword"
710+
msg = (
711+
"{arg!r} parameter is positional only, "
712+
"but was passed as a keyword"
713+
)
711714
msg = msg.format(arg=param.name)
712715
raise TypeError(msg)
713716
parameters_ex = (param,)

graphene/types/argument.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ def to_arguments(args, extra_args=None):
7575
arg_name = default_name or arg.name
7676
assert (
7777
arg_name not in arguments
78-
), 'More than one Argument have same name "{}".'.format(
79-
arg_name
80-
)
78+
), 'More than one Argument have same name "{}".'.format(arg_name)
8179
arguments[arg_name] = arg
8280

8381
return arguments

graphene/types/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
from ..utils.subclass_with_meta import SubclassWithMeta
22
from ..utils.trim_docstring import trim_docstring
3+
import six
4+
5+
if six.PY3:
6+
from typing import Type
37

48

59
class BaseOptions(object):

graphene/types/scalars.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
from .base import BaseOptions, BaseType
55
from .unmountedtype import UnmountedType
66

7+
if six.PY3:
8+
from typing import Any
9+
710

811
class ScalarOptions(BaseOptions):
912
pass

graphene/types/tests/test_definition.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
from ..argument import Argument
42
from ..enum import Enum
53
from ..field import Field

graphene/types/tests/test_inputobjecttype.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
from ..argument import Argument
32
from ..field import Field
43
from ..inputfield import InputField

graphene/types/tests/test_json.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
from ..json import JSONString
32
from ..objecttype import ObjectType
43
from ..schema import Schema

graphene/types/tests/test_mountedtype.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
from ..field import Field
32
from ..scalars import String
43

graphene/types/tests/test_resolver.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
from ..resolver import (
32
attr_resolver,
43
dict_resolver,

graphene/types/tests/test_scalar.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
from ..scalars import Scalar
32

43

graphene/utils/str_converters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ def to_snake_case(name):
1818

1919

2020
def to_const(string):
21-
return re.sub("[\W|^]+", "_", string).upper() # noqa
21+
return re.sub(r"[\W|^]+", "_", string).upper() # noqa

0 commit comments

Comments
 (0)