Skip to content

Commit c6e400b

Browse files
authored
Bump pre-commit hook versions (#230)
1 parent cdb299d commit c6e400b

File tree

6 files changed

+29
-14
lines changed

6 files changed

+29
-14
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
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
14+
- id: trailing-whitespace
15+
exclude: README.md
1516
- repo: https://github.com/asottile/pyupgrade
16-
rev: v1.4.0
17+
rev: v1.12.0
1718
hooks:
1819
- id: pyupgrade
1920
- repo: https://github.com/ambv/black
20-
rev: 18.6b4
21+
rev: 18.9b0
2122
hooks:
2223
- id: black
23-
language_version: python3.6
24+
language_version: python3

graphql/execution/utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,15 @@ def __init__(
121121
self.variable_values = variable_values
122122
self.errors = errors
123123
self.context_value = context_value
124-
self.argument_values_cache = {} # type: Dict[Tuple[GraphQLField, Field], Dict[str, Any]]
124+
self.argument_values_cache = (
125+
{}
126+
) # type: Dict[Tuple[GraphQLField, Field], Dict[str, Any]]
125127
self.executor = executor
126128
self.middleware = middleware
127129
self.allow_subscriptions = allow_subscriptions
128-
self._subfields_cache = {} # type: Dict[Tuple[GraphQLObjectType, Tuple[Field, ...]], DefaultOrderedDict]
130+
self._subfields_cache = (
131+
{}
132+
) # type: Dict[Tuple[GraphQLObjectType, Tuple[Field, ...]], DefaultOrderedDict]
129133

130134
def get_field_resolver(self, field_resolver):
131135
# type: (Callable) -> Callable

graphql/language/lexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def position_after_whitespace(body, start_position):
245245

246246
def read_number(source, start, first_code):
247247
# type: (Source, int, Optional[int]) -> Token
248-
"""Reads a number token from the source file, either a float
248+
r"""Reads a number token from the source file, either a float
249249
or an int depending on whether a decimal point appears.
250250
251251
Int: -?(0|[1-9][0-9]*)

graphql/utils/type_info.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ def __init__(self, schema, get_field_def_fn=get_field_def):
6060
# type: (GraphQLSchema, Callable) -> None
6161
self._schema = schema
6262
self._type_stack = [] # type: List[Optional[GraphQLType]]
63-
self._parent_type_stack = [] # type: List[Union[GraphQLInterfaceType, GraphQLObjectType, None]]
64-
self._input_type_stack = [] # type: List[Optional[Union[GraphQLInputObjectType, GraphQLNonNull, GraphQLList, GraphQLScalarType, None]]]
63+
self._parent_type_stack = (
64+
[]
65+
) # type: List[Union[GraphQLInterfaceType, GraphQLObjectType, None]]
66+
self._input_type_stack = (
67+
[]
68+
) # type: List[Optional[Union[GraphQLInputObjectType, GraphQLNonNull, GraphQLList, GraphQLScalarType, None]]]
6569
self._field_def_stack = [] # type: List[Optional[GraphQLField]]
6670
self._directive = None # type: Optional[GraphQLDirective]
6771
self._argument = None # type: Optional[GraphQLArgument]

graphql/validation/rules/overlapping_fields_can_be_merged.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ def __init__(self, context):
4747
# A cache for the "field map" and list of fragment names found in any given
4848
# selection set. Selection sets may be asked for this information multiple
4949
# times, so this improves the performance of this validator.
50-
self._cached_fields_and_fragment_names = {} # type: Dict[SelectionSet, Tuple[Dict[str, List[Tuple[Union[GraphQLInterfaceType, GraphQLObjectType, None], Field, GraphQLField]]], List[str]]]
50+
self._cached_fields_and_fragment_names = (
51+
{}
52+
) # type: Dict[SelectionSet, Tuple[Dict[str, List[Tuple[Union[GraphQLInterfaceType, GraphQLObjectType, None], Field, GraphQLField]]], List[str]]]
5153

5254
def leave_SelectionSet(
5355
self,

graphql/validation/validation.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,13 @@ def __init__(self, schema, ast, type_info):
8686
self._errors = [] # type: List[GraphQLError]
8787
self._fragments = None # type: Optional[Dict[str, FragmentDefinition]]
8888
self._fragment_spreads = {} # type: Dict[Node, List[FragmentSpread]]
89-
self._recursively_referenced_fragments = {} # type: Dict[OperationDefinition, List[FragmentSpread]]
89+
self._recursively_referenced_fragments = (
90+
{}
91+
) # type: Dict[OperationDefinition, List[FragmentSpread]]
9092
self._variable_usages = {} # type: Dict[Node, List[VariableUsage]]
91-
self._recursive_variable_usages = {} # type: Dict[OperationDefinition, List[VariableUsage]]
93+
self._recursive_variable_usages = (
94+
{}
95+
) # type: Dict[OperationDefinition, List[VariableUsage]]
9296

9397
def report_error(self, error):
9498
self._errors.append(error)

0 commit comments

Comments
 (0)