Skip to content

Commit

Permalink
Run pre-commit autoupdate to bump versions of precommit hooks, then r…
Browse files Browse the repository at this point in the history
…un them on all files (#913)
  • Loading branch information
dan98765 authored and ekampf committed Mar 8, 2019
1 parent fd0bd0c commit 9ae2359
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 20 deletions.
16 changes: 10 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions UPGRADE-v2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
5 changes: 4 additions & 1 deletion graphene/pyutils/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,10 @@ def _bind(self, args, kwargs, partial=False):
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,)
Expand Down
4 changes: 1 addition & 3 deletions graphene/types/argument.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions graphene/types/base.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
3 changes: 3 additions & 0 deletions graphene/types/scalars.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
from .base import BaseOptions, BaseType
from .unmountedtype import UnmountedType

if six.PY3:
from typing import Any


class ScalarOptions(BaseOptions):
pass
Expand Down
2 changes: 0 additions & 2 deletions graphene/types/tests/test_definition.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


from ..argument import Argument
from ..enum import Enum
from ..field import Field
Expand Down
1 change: 0 additions & 1 deletion graphene/types/tests/test_inputobjecttype.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from ..argument import Argument
from ..field import Field
from ..inputfield import InputField
Expand Down
1 change: 0 additions & 1 deletion graphene/types/tests/test_json.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from ..json import JSONString
from ..objecttype import ObjectType
from ..schema import Schema
Expand Down
1 change: 0 additions & 1 deletion graphene/types/tests/test_mountedtype.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from ..field import Field
from ..scalars import String

Expand Down
1 change: 0 additions & 1 deletion graphene/types/tests/test_resolver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from ..resolver import (
attr_resolver,
dict_resolver,
Expand Down
1 change: 0 additions & 1 deletion graphene/types/tests/test_scalar.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from ..scalars import Scalar


Expand Down
2 changes: 1 addition & 1 deletion graphene/utils/str_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9ae2359

Please sign in to comment.