Skip to content

Bump precommit hooks #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
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: 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.6
language_version: python3
8 changes: 6 additions & 2 deletions graphql/execution/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,15 @@ def __init__(
self.variable_values = variable_values
self.errors = errors
self.context_value = context_value
self.argument_values_cache = {} # type: Dict[Tuple[GraphQLField, Field], Dict[str, Any]]
self.argument_values_cache = (
{}
) # type: Dict[Tuple[GraphQLField, Field], Dict[str, Any]]
self.executor = executor
self.middleware = middleware
self.allow_subscriptions = allow_subscriptions
self._subfields_cache = {} # type: Dict[Tuple[GraphQLObjectType, Tuple[Field, ...]], DefaultOrderedDict]
self._subfields_cache = (
{}
) # type: Dict[Tuple[GraphQLObjectType, Tuple[Field, ...]], DefaultOrderedDict]

def get_field_resolver(self, field_resolver):
# type: (Callable) -> Callable
Expand Down
2 changes: 1 addition & 1 deletion graphql/language/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def position_after_whitespace(body, start_position):

def read_number(source, start, first_code):
# type: (Source, int, Optional[int]) -> Token
"""Reads a number token from the source file, either a float
r"""Reads a number token from the source file, either a float
or an int depending on whether a decimal point appears.

Int: -?(0|[1-9][0-9]*)
Expand Down
8 changes: 6 additions & 2 deletions graphql/utils/type_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ def __init__(self, schema, get_field_def_fn=get_field_def):
# type: (GraphQLSchema, Callable) -> None
self._schema = schema
self._type_stack = [] # type: List[Optional[GraphQLType]]
self._parent_type_stack = [] # type: List[Union[GraphQLInterfaceType, GraphQLObjectType, None]]
self._input_type_stack = [] # type: List[Optional[Union[GraphQLInputObjectType, GraphQLNonNull, GraphQLList, GraphQLScalarType, None]]]
self._parent_type_stack = (
[]
) # type: List[Union[GraphQLInterfaceType, GraphQLObjectType, None]]
self._input_type_stack = (
[]
) # type: List[Optional[Union[GraphQLInputObjectType, GraphQLNonNull, GraphQLList, GraphQLScalarType, None]]]
self._field_def_stack = [] # type: List[Optional[GraphQLField]]
self._directive = None # type: Optional[GraphQLDirective]
self._argument = None # type: Optional[GraphQLArgument]
Expand Down
4 changes: 3 additions & 1 deletion graphql/validation/rules/overlapping_fields_can_be_merged.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def __init__(self, context):
# A cache for the "field map" and list of fragment names found in any given
# selection set. Selection sets may be asked for this information multiple
# times, so this improves the performance of this validator.
self._cached_fields_and_fragment_names = {} # type: Dict[SelectionSet, Tuple[Dict[str, List[Tuple[Union[GraphQLInterfaceType, GraphQLObjectType, None], Field, GraphQLField]]], List[str]]]
self._cached_fields_and_fragment_names = (
{}
) # type: Dict[SelectionSet, Tuple[Dict[str, List[Tuple[Union[GraphQLInterfaceType, GraphQLObjectType, None], Field, GraphQLField]]], List[str]]]

def leave_SelectionSet(
self,
Expand Down
8 changes: 6 additions & 2 deletions graphql/validation/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,13 @@ def __init__(self, schema, ast, type_info):
self._errors = [] # type: List[GraphQLError]
self._fragments = None # type: Optional[Dict[str, FragmentDefinition]]
self._fragment_spreads = {} # type: Dict[Node, List[FragmentSpread]]
self._recursively_referenced_fragments = {} # type: Dict[OperationDefinition, List[FragmentSpread]]
self._recursively_referenced_fragments = (
{}
) # type: Dict[OperationDefinition, List[FragmentSpread]]
self._variable_usages = {} # type: Dict[Node, List[VariableUsage]]
self._recursive_variable_usages = {} # type: Dict[OperationDefinition, List[VariableUsage]]
self._recursive_variable_usages = (
{}
) # type: Dict[OperationDefinition, List[VariableUsage]]

def report_error(self, error):
self._errors.append(error)
Expand Down