8000 Add flake8 hook only run on some files (#232) · audacious-io/graphql-core@9d558c3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d558c3

Browse files
authored
Add flake8 hook only run on some files (graphql-python#232)
* Add flake8 hook and run pre-commit autoupdate * Set up a very permissive initial flake8 config and fix flake8 violations
1 parent c9ee5d9 commit 9d558c3

File tree

14 files changed

+16
-23
lines changed

14 files changed

+16
-23
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ repos:
1818
hooks:
1919
- id: pyupgrade
2020
- repo: https://github.com/ambv/black
21-
rev: 18.9b0
21+
rev: 19.3b0
2222
hooks:
2323
- id: black
24-
language_version: python3
24+
language_version: python3.6
25+
- repo: https://github.com/pycqa/flake8
26+
rev: 3.7.7
27+
hooks:
28+
- id: flake8
29+
exclude: (^docs/.*$|^scripts/generate_ast.py$|test_.*$)

graphql/backend/core.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
# Necessary for static type checking
1212
if False: # flake8: noqa
1313
from typing import Any, Optional, Union
14-
from .base import GraphQLDocument
1514
from ..language.ast import Document
1615
from ..type.schema import GraphQLSchema
17-
from ..execution.base import ExecutionResult
1816
from rx import Observable
1917

2018

graphql/execution/executor.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
# Necessary for static type checking
4444
if False: # flake8: noqa
4545
from typing import Any, Optional, Union, Dict, List, Callable
46-
from rx import Observable
47-
from ..type.schema import GraphQLSchema
4846
from ..language.ast import Document, OperationDefinition, Field
4947

5048
logger = logging.getLogger(__name__)

graphql/execution/tests/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from promise import Promise
2-
from promise.promise import Promise
32
from typing import Any
43

54

graphql/execution/values.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from ..language.ast import VariableDefinition, Argument
2727
from ..type.schema import GraphQLSchema
2828
from ..type.definition import GraphQLArgument
29-
from typing import Any, Dict, List, Union, Dict, Optional
29+
from typing import Any, List, Union, Dict, Optional
3030

3131
__all__ = ["get_variable_values", "get_argument_values"]
3232

graphql/language/parser.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
# Necessary for static type checking
99
if False: # flake8: noqa
1010
from typing import Dict, Union, Any, Optional, Callable, List
11-
from ..error.syntax_error import GraphQLSyntaxError
12-
from .source import Source
1311
from .lexer import Token
1412
from .ast import (
1513
Document,

graphql/utils/get_field_def.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Necessary for static type checking
99
if False: # flake8: noqa
1010
from ..language.ast import Field
11-
from ..type.definition import GraphQLField, GraphQLInterfaceType, GraphQLObjectType
11+
from ..type.definition import GraphQLField
1212
from ..type.schema import GraphQLSchema
1313
from typing import Optional, Union
1414

graphql/utils/is_valid_literal_value.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# Necessary for static type checking
1212
if False: # flake8: noqa
1313
from ..language.ast import ObjectValue, StringValue
14-
from ..type.definition import GraphQLInputObjectType, GraphQLScalarType
1514
from typing import Union, Any, List
1615

1716
_empty_list = [] # type: List

graphql/utils/type_comparators.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@
99

1010
# Necessary for static type checking
1111
if False: # flake8: noqa
12-
from ..type.definition import (
13-
GraphQLScalarType,
14-
GraphQLInterfaceType,
15-
GraphQLObjectType,
16-
GraphQLUnionType,
17-
)
12+
from ..type.definition import GraphQLScalarType
1813
from ..type.typemap import GraphQLTypeMap
1914
from ..type.schema import GraphQLSchema
2015
from typing import Union

graphql/utils/type_info.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from ..type.schema import GraphQLSchema
1717
from ..type.definition import (
1818
GraphQLType,
19-
GraphQLInputObjectType,
2019
GraphQLInterfaceType,
2120
GraphQLObjectType,
2221
GraphQLField,

0 commit comments

Comments
 (0)
0