Skip to content

Commit ea0c52a

Browse files
committed
Some adaptations to long lines after reformatting
1 parent 1bcd466 commit ea0c52a

20 files changed

+86
-102
lines changed

graphql/error/graphql_error.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
from .print_error import print_error
55

66
if TYPE_CHECKING: # pragma: no cover
7-
from ..language.ast import Node # noqa
8-
from ..language.location import SourceLocation # noqa
9-
from ..language.source import Source # noqa
7+
from ..language.ast import Node # noqa: F401
8+
from ..language.location import SourceLocation # noqa: F401
9+
from ..language.source import Source # noqa: F401
1010

1111
__all__ = ["GraphQLError"]
1212

graphql/error/located_error.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from .graphql_error import GraphQLError
44

55
if TYPE_CHECKING: # pragma: no cover
6-
from ..language.ast import Node # noqa
6+
from ..language.ast import Node # noqa: F401
77

88
__all__ = ["located_error"]
99

graphql/language/parser.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ def parse(
107107
source,
108108
no_location=no_location,
109109
experimental_fragment_variables=experimental_fragment_variables,
110-
experimental_variable_definition_directives=experimental_variable_definition_directives, # noqa
110+
experimental_variable_definition_directives=(
111+
experimental_variable_definition_directives
112+
),
111113
)
112114
return parse_document(lexer)
113115

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,3 @@
4646
include_package_data=True,
4747
zip_safe=False,
4848
)
49-

tests/execution/test_mutations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ async def promise_and_fail_to_change_the_number(self, newNumber: int):
8080
"promiseAndFailToChangeTheNumber": GraphQLField(
8181
numberHolderType,
8282
args={"newNumber": GraphQLArgument(GraphQLInt)},
83-
resolve=lambda obj, _info, newNumber: obj.promise_and_fail_to_change_the_number( # noqa
84-
newNumber
83+
resolve=lambda obj, _info, newNumber: (
84+
obj.promise_and_fail_to_change_the_number(newNumber)
8585
),
8686
),
8787
},

tests/execution/test_variables.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def field_with_input_arg(input_arg: GraphQLArgument):
9090
"fieldWithDefaultArgumentValue": field_with_input_arg(
9191
GraphQLArgument(GraphQLString, default_value="Hello World")
9292
),
93-
"fieldWithNonNullableStringInputAndDefaultArgumentValue": field_with_input_arg(
93+
"fieldWithNonNullableStringInputAndDefaultArgValue": field_with_input_arg(
9494
GraphQLArgument(GraphQLNonNull(GraphQLString), default_value="Hello World")
9595
),
9696
"fieldWithNestedInputObject": field_with_input_arg(
@@ -162,7 +162,8 @@ def properly_parses_null_value_to_null():
162162

163163
assert result == (
164164
{
165-
"fieldWithObjectInput": "{'a': None, 'b': None, 'c': 'C', 'd': None}" # noqa
165+
"fieldWithObjectInput": "{'a': None, 'b': None,"
166+
" 'c': 'C', 'd': None}"
166167
},
167168
None,
168169
)
@@ -907,14 +908,12 @@ def when_no_runtime_value_is_provided_to_a_non_null_argument():
907908
result = execute_query(
908909
"""
909910
query optionalVariable($optional: String) {
910-
fieldWithNonNullableStringInputAndDefaultArgumentValue(input: $optional)
911+
fieldWithNonNullableStringInputAndDefaultArgValue(input: $optional)
911912
}
912-
""" # noqa
913+
"""
913914
)
914915

915916
assert result == (
916-
{
917-
"fieldWithNonNullableStringInputAndDefaultArgumentValue": "'Hello World'" # noqa
918-
},
917+
{"fieldWithNonNullableStringInputAndDefaultArgValue": "'Hello World'"},
919918
None,
920919
)

tests/language/test_printer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,4 @@ def prints_kitchen_sink(kitchen_sink): # noqa: F811
195195
query
196196
}
197197
'''
198-
) # noqa
198+
)

tests/language/test_schema_printer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,5 +156,5 @@ def prints_kitchen_sink(kitchen_sink): # noqa: F811
156156
extend schema @onSchema {
157157
subscription: SubscriptionType
158158
}
159-
''' # noqa
159+
''' # noqa: E501
160160
)

tests/type/test_enum.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ def may_be_internally_represented_with_complex_values():
324324
{"first": "ONE", "second": "TWO", "good": "TWO", "bad": None},
325325
[
326326
{
327-
"message": "Expected a value of type 'Complex' but received: Complex2", # noqa
327+
"message": "Expected a value of type 'Complex'"
328+
" but received: Complex2",
328329
"locations": [(6, 15)],
329330
"path": ["bad"],
330331
}

tests/type/test_introspection.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,25 +1214,28 @@ def exposes_descriptions_on_types_and_fields():
12141214
"fields": [
12151215
{
12161216
"name": "types",
1217-
"description": "A list of all types supported by this server.", # noqa
1217+
"description": "A list of all types supported"
1218+
" by this server.",
12181219
},
12191220
{
12201221
"name": "queryType",
1221-
"description": "The type that query operations will be rooted at.", # noqa
1222+
"description": "The type that query operations"
1223+
" will be rooted at.",
12221224
},
12231225
{
12241226
"name": "mutationType",
1225-
"description": "If this server supports mutation, the type that" # noqa
1226-
" mutation operations will be rooted at.", # noqa
1227+
"description": "If this server supports mutation, the type"
1228+
" that mutation operations will be rooted at.",
12271229
},
12281230
{
12291231
"name": "subscriptionType",
1230-
"description": "If this server support subscription, the type" # noqa
1231-
" that subscription operations will be rooted at.", # noqa
1232+
"description": "If this server support subscription,"
1233+
" the type that subscription operations will be rooted at.",
12321234
},
12331235
{
12341236
"name": "directives",
1235-
"description": "A list of all directives supported by this server.", # noqa
1237+
"description": "A list of all directives supported"
1238+
" by this server.",
12361239
},
12371240
],
12381241
}

tests/type/test_validation.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def accepts_a_schema_whose_query_and_mutation_types_are_object_types():
133133

134134
schema_with_def = build_schema(
135135
"""
136-
schema {
136+
schema {
137137
query: QueryRoot
138138
mutation: MutationRoot
139139
}
@@ -165,7 +165,7 @@ def accepts_a_schema_whose_query_and_subscription_types_are_object_types():
165165

166166
schema_with_def = build_schema(
167167
"""
168-
schema {
168+
schema {
169169
query: QueryRoot
170170
subscription: SubscriptionRoot
171171
}
@@ -184,10 +184,10 @@ def accepts_a_schema_whose_query_and_subscription_types_are_object_types():
184184
def rejects_a_schema_without_a_query_type():
185185
schema = build_schema(
186186
"""
187-
type Mutation {
188-
test: String
189-
}
190-
"""
187+
type Mutation {
188+
test: String
189+
}
190+
"""
191191
)
192192
assert validate_schema(schema) == [
193193
{"message": "Query root type must be provided.", "locations": None}
@@ -343,47 +343,47 @@ def rejects_a_schema_extended_with_invalid_root_types():
343343
schema,
344344
parse(
345345
"""
346-
extend schema {
347-
query: SomeInputObject
348-
}
349-
"""
346+
extend schema {
347+
query: SomeInputObject
348+
}
349+
"""
350350
),
351351
)
352352
schema = extend_schema(
353353
schema,
354354
parse(
355355
"""
356-
extend schema {
357-
mutation: SomeInputObject
358-
}
359-
"""
356+
extend schema {
357+
mutation: SomeInputObject
358+
}
359+
"""
360360
),
361361
)
362362
schema = extend_schema(
363363
schema,
364364
parse(
365365
"""
366-
extend schema {
367-
subscription: SomeInputObject
368-
}
369-
"""
366+
extend schema {
367+
subscription: SomeInputObject
368+
}
369+
"""
370370
),
371371
)
372372
assert validate_schema(schema) == [
373373
{
374374
"message": "Query root type must be Object type,"
375375
" it cannot be SomeInputObject.",
376-
"locations": [(3, 22)],
376+
"locations": [(3, 26)],
377377
},
378378
{
379379
"message": "Mutation root type must be Object type"
380380
" if provided, it cannot be SomeInputObject.",
381-
"locations": [(3, 25)],
381+
"locations": [(3, 29)],
382382
},
383383
{
384384
"message": "Subscription root type must be Object type"
385385
" if provided, it cannot be SomeInputObject.",
386-
"locations": [(3, 29)],
386+
"locations": [(3, 33)],
387387
},
388388
]
389389

@@ -521,17 +521,17 @@ def rejects_a_union_type_with_empty_types():
521521
schema,
522522
parse(
523523
"""
524-
directive @test on UNION
524+
directive @test on UNION
525525
526-
extend union BadUnion @test
527-
"""
526+
extend union BadUnion @test
527+
"""
528528
),
529529
)
530530
assert validate_schema(schema) == [
531531
{
532532
"message": "Union type BadUnion must define one or more"
533533
" member types.",
534-
"locations": [(6, 13), (4, 13)],
534+
"locations": [(6, 13), (4, 17)],
535535
}
536536
]
537537

tests/utilities/test_build_ast_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ def simple_type_with_mutation():
553553
addHelloScalars(str: String, int: Int, bool: Boolean): HelloScalars
554554
}
555555
"""
556-
) # noqa
556+
)
557557
output = cycle_output(body)
558558
assert output == body
559559

@@ -575,7 +575,7 @@ def simple_type_with_subscription():
575575
subscribeHelloScalars(str: String, int: Int, bool: Boolean): HelloScalars
576576
}
577577
"""
578-
) # noqa
578+
)
579579
output = cycle_output(body)
580580
assert output == body
581581

tests/utilities/test_extend_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ def builds_types_with_deprecated_fields_and_values():
457457
DEPRECATED @deprecated(reason: "do not use")
458458
}
459459
"""
460-
) # noqa
460+
)
461461
deprecated_field_def = extended_schema.get_type(
462462
"TypeWithDeprecatedField"
463463
).fields["newDeprecatedField"]

tests/utilities/test_find_breaking_changes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ def should_detect_if_a_required_field_argument_was_added():
636636
field1: String
637637
}
638638
"""
639-
) # noqa
639+
)
640640

641641
assert find_arg_changes(old_schema, new_schema).breaking_changes == [
642642
(
@@ -799,7 +799,7 @@ def should_detect_all_breaking_changes():
799799
field1: String
800800
}
801801
"""
802-
) # noqa
802+
)
803803

804804
new_schema = build_schema(
805805
"""
@@ -844,7 +844,7 @@ def should_detect_all_breaking_changes():
844844
field1: String
845845
}
846846
"""
847-
) # noqa
847+
)
848848

849849
expected_breaking_changes = [
850850
(BreakingChangeType.TYPE_REMOVED, "Int was removed."),

0 commit comments

Comments
 (0)