Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2ab14cc

Browse files
asottileJukkaL
authored andcommitted
Add back a few lint checks now that flake8 is better (#6927)
1 parent 1a84dc6 commit 2ab14cc

27 files changed

Lines changed: 31 additions & 47 deletions

conftest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import os.path
22

3-
import pytest
4-
53
pytest_plugins = [
64
'mypy.test.data',
75
]

mypy/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ def __init__(self, data_dir: str,
499499
search_paths: SearchPaths,
500500
ignore_prefix: str,
501501
source_set: BuildSourceSet,
502-
reports: Optional['Reports'],
502+
reports: 'Optional[Reports]',
503503
options: Options,
504504
version_id: str,
505505
plugin: Plugin,

mypy/checkexpr.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
from collections import OrderedDict
44
from contextlib import contextmanager
55
from typing import (
6-
cast, Dict, Set, List, Tuple, Callable, Union, Optional, Iterable,
7-
Sequence, Iterator
6+
cast, Dict, Set, List, Tuple, Callable, Union, Optional, Sequence, Iterator
87
)
98
MYPY = False
109
if MYPY:

mypy/fastparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def ast3_parse(source: Union[str, bytes], filename: str, mode: str,
105105
Constant = Any
106106
except ImportError:
107107
try:
108-
from typed_ast import ast35 # type: ignore
108+
from typed_ast import ast35 # type: ignore # noqa: F401
109109
except ImportError:
110110
print('The typed_ast package is not installed.\n'
111111
'You can install it with `python3 -m pip install typed-ast`.',

mypy/fastparse2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
from mypy.fastparse import ast3, ast3_parse
6363
except ImportError:
6464
try:
65-
from typed_ast import ast35 # type: ignore
65+
from typed_ast import ast35 # type: ignore # noqa: F401
6666
except ImportError:
6767
print('The typed_ast package is not installed.\n'
6868
'You can install it with `python3 -m pip install typed-ast`.',

mypy/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def format_bare(self, typ: Type, verbosity: int = 0) -> str:
294294
arg_strings.append(
295295
self.format_bare(
296296
arg_type,
297-
verbosity = max(verbosity - 1, 0)))
297+
verbosity=max(verbosity - 1, 0)))
298298
else:
299299
constructor = ARG_CONSTRUCTOR_NAMES[arg_kind]
300300
if arg_kind in (ARG_STAR, ARG_STAR2) or arg_name is None:

mypy/metastore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import time
1616

1717
from abc import abstractmethod
18-
from typing import Dict, List, Set, Iterable, Any, Optional
18+
from typing import List, Iterable, Any, Optional
1919

2020

2121
class MetadataStore:

mypy/newsemanal/semanal_enum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from mypy.nodes import (
99
Expression, Context, TypeInfo, AssignmentStmt, NameExpr, CallExpr, RefExpr, StrExpr,
10-
UnicodeExpr, TupleExpr, ListExpr, DictExpr, Var, SymbolTableNode, GDEF, MDEF, ARG_POS,
10+
UnicodeExpr, TupleExpr, ListExpr, DictExpr, Var, SymbolTableNode, MDEF, ARG_POS,
1111
EnumCallExpr
1212
)
1313
from mypy.newsemanal.semanal_shared import SemanticAnalyzerInterface

mypy/newsemanal/semanal_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from typing import List, Tuple, Optional, Union, Callable, Iterator
2929

3030
from mypy.nodes import (
31-
MypyFile, TypeInfo, FuncDef, Decorator, OverloadedFuncDef, SymbolTableNode, Var, ClassDef
31+
MypyFile, TypeInfo, FuncDef, Decorator, OverloadedFuncDef, Var
3232
)
3333
from mypy.newsemanal.semanal_typeargs import TypeArgumentAnalyzer
3434
from mypy.state import strict_optional_set

mypy/newsemanal/semanal_namedtuple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
Var, EllipsisExpr, Argument, StrExpr, BytesExpr, UnicodeExpr, ExpressionStmt, NameExpr,
1717
AssignmentStmt, PassStmt, Decorator, FuncBase, ClassDef, Expression, RefExpr, TypeInfo,
1818
NamedTupleExpr, CallExpr, Context, TupleExpr, ListExpr, SymbolTableNode, FuncDef, Block,
19-
TempNode, SymbolTable, TypeVarExpr, ARG_POS, ARG_NAMED_OPT, ARG_OPT, MDEF, GDEF
19+
TempNode, SymbolTable, TypeVarExpr, ARG_POS, ARG_NAMED_OPT, ARG_OPT, MDEF
2020
)
2121
from mypy.options import Options
2222
from mypy.exprtotype import expr_to_unanalyzed_type, TypeTranslationError

0 commit comments

Comments
 (0)