Skip to content

Commit 9b839f1

Browse files
committed
Fixed lint errors
1 parent b417a65 commit 9b839f1

23 files changed

+55
-36
lines changed

bin/autolinter

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

3-
autoflake ./ -r --remove-unused-variables --remove-all-unused-imports --in-place
4-
autopep8 ./ -r --in-place --experimental --aggressive --max-line-length 120
5-
isort -rc .
3+
autoflake ./examples/ ./graphene/ -r --remove-unused-variables --remove-all-unused-imports --in-place
4+
autopep8 ./examples/ ./graphene/ -r --in-place --experimental --aggressive --max-line-length 120
5+
isort -rc ./examples/ ./graphene/

graphene/contrib/django/tests/test_types.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from graphql.core.type import GraphQLInterfaceType, GraphQLObjectType
1+
from graphql.core.type import GraphQLObjectType
22
from mock import patch
3-
from pytest import raises
43

54
from graphene import Schema
65
from graphene.contrib.django.types import DjangoNode, DjangoObjectType

graphene/contrib/django/types.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import six
21
import inspect
32

3+
import six
44
from django.db import models
55

6-
from ...core.classtypes.objecttype import ObjectTypeMeta, ObjectType
7-
from ...relay.types import Node, NodeMeta, Connection
6+
from ...core.classtypes.objecttype import ObjectType, ObjectTypeMeta
7+
from ...relay.types import Connection, Node, NodeMeta
88
from .converter import convert_django_field
99
from .options import DjangoOptions
1010
from .utils import get_reverse_fields, maybe_queryset
@@ -47,6 +47,7 @@ def construct(cls, *args, **kwargs):
4747

4848

4949
class InstanceObjectType(ObjectType):
50+
5051
class Meta:
5152
abstract = True
5253

@@ -75,6 +76,7 @@ def __getattr__(self, attr):
7576

7677
class DjangoObjectType(six.with_metaclass(
7778
DjangoObjectTypeMeta, InstanceObjectType)):
79+
7880
class Meta:
7981
abstract = True
8082

@@ -92,12 +94,14 @@ class DjangoNodeMeta(DjangoObjectTypeMeta, NodeMeta):
9294

9395

9496
class NodeInstance(Node, InstanceObjectType):
97+
9598
class Meta:
9699
abstract = True
97100

98101

99102
class DjangoNode(six.with_metaclass(
100103
DjangoNodeMeta, NodeInstance)):
104+
101105
class Meta:
102106
abstract = True
103107

graphene/core/classtypes/base.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
from collections import OrderedDict
1+
import copy
22
import inspect
3+
from collections import OrderedDict
4+
35
import six
4-
import copy
56

67
from ..exceptions import SkipField
78
from .options import Options
@@ -54,6 +55,7 @@ def construct(cls, bases, attrs):
5455

5556

5657
class ClassType(six.with_metaclass(ClassTypeMeta)):
58+
5759
class Meta:
5860
abstract = True
5961

@@ -63,6 +65,7 @@ def internal_type(cls, schema):
6365

6466

6567
class FieldsOptions(Options):
68+
6669
def __init__(self, *args, **kwargs):
6770
super(FieldsOptions, self).__init__(*args, **kwargs)
6871
self.local_fields = []
@@ -107,14 +110,14 @@ def extend_fields(cls, bases):
107110
new_field = copy.copy(field)
108111
cls.add_to_class(field.attname, new_field)
109112

110-
111113
def construct(cls, bases, attrs):
112114
cls = super(FieldsClassTypeMeta, cls).construct(bases, attrs)
113115
cls.extend_fields(bases)
114116
return cls
115117

116118

117119
class FieldsClassType(six.with_metaclass(FieldsClassTypeMeta, ClassType)):
120+
118121
class Meta:
119122
abstract = True
120123

graphene/core/classtypes/inputobjecttype.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77

88
class InputObjectType(FieldsClassType):
9+
910
class Meta:
1011
abstract = True
1112

graphene/core/classtypes/interface.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import six
21
from functools import partial
32

3+
import six
44
from graphql.core.type import GraphQLInterfaceType
55

66
from .base import FieldsClassTypeMeta
77
from .objecttype import ObjectType, ObjectTypeMeta
88

99

1010
class InterfaceMeta(ObjectTypeMeta):
11+
1112
def construct(cls, bases, attrs):
1213
if cls._meta.abstract or Interface in bases:
1314
# Return Interface type
@@ -26,6 +27,7 @@ def construct(cls, bases, attrs):
2627

2728

2829
class Interface(six.with_metaclass(InterfaceMeta, ObjectType)):
30+
2931
class Meta:
3032
abstract = True
3133

graphene/core/classtypes/mutation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66

77
class MutationMeta(ObjectTypeMeta):
8+
89
def construct(cls, bases, attrs):
910
input_class = attrs.pop('Input', None)
1011
if input_class:
@@ -22,6 +23,7 @@ def construct_arguments(cls, items):
2223

2324

2425
class Mutation(six.with_metaclass(MutationMeta, ObjectType)):
26+
2527
class Meta:
2628
abstract = True
2729

graphene/core/classtypes/objecttype.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import six
21
from functools import partial
32

3+
import six
44
from graphql.core.type import GraphQLObjectType
55

66
from graphene import signals
7-
from .base import FieldsOptions, FieldsClassType, FieldsClassTypeMeta
7+
8+
from .base import FieldsClassType, FieldsClassTypeMeta, FieldsOptions
89
from .uniontype import UnionType
910

1011

@@ -15,13 +16,15 @@ def is_objecttype(cls):
1516

1617

1718
class ObjectTypeOptions(FieldsOptions):
19+
1820
def __init__(self, *args, **kwargs):
1921
super(ObjectTypeOptions, self).__init__(*args, **kwargs)
2022
self.interface = False
2123
self.interfaces = []
2224

2325

2426
class ObjectTypeMeta(FieldsClassTypeMeta):
27+
2528
def construct(cls, bases, attrs):
2629
cls = super(ObjectTypeMeta, cls).construct(bases, attrs)
2730
if not cls._meta.abstract:
@@ -39,6 +42,7 @@ def construct(cls, bases, attrs):
3942

4043

4144
class ObjectType(six.with_metaclass(ObjectTypeMeta, FieldsClassType)):
45+
4246
class Meta:
4347
abstract = True
4448

graphene/core/classtypes/options.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
class Options(object):
2+
23
def __init__(self, meta=None, **defaults):
34
self.meta = meta
45
self.abstract = False

graphene/core/classtypes/scalar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from graphql.core.type import GraphQLScalarType
22

3-
from .base import ClassType
43
from ..types.base import MountedType
4+
from .base import ClassType
55

66

77
class Scalar(ClassType, MountedType):

0 commit comments

Comments
 (0)