Skip to content

Commit becbab6

Browse files
authored
upgrade flake8 to 4.0.1 (#706)
I removed the erroring type annotations since we are not (yet) using a type checker
1 parent f736615 commit becbab6

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

pyflakes/checker.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,20 +151,18 @@ def _is_name_or_attr(node, name): # type: (ast.AST, str) -> bool
151151

152152

153153
def _must_match(regex, string, pos):
154-
# type: (Pattern[str], str, int) -> Match[str]
155154
match = regex.match(string, pos)
156155
assert match is not None
157156
return match
158157

159158

160-
def parse_percent_format(s): # type: (str) -> Tuple[PercentFormat, ...]
159+
def parse_percent_format(s):
161160
"""Parses the string component of a `'...' % ...` format call
162161
163162
Copied from https://github.com/asottile/pyupgrade at v1.20.1
164163
"""
165164

166165
def _parse_inner():
167-
# type: () -> Generator[PercentFormat, None, None]
168166
string_start = 0
169167
string_end = 0
170168
in_fmt = False
@@ -184,7 +182,7 @@ def _parse_inner():
184182
else:
185183
key_match = MAPPING_KEY_RE.match(s, i)
186184
if key_match:
187-
key = key_match.group(1) # type: Optional[str]
185+
key = key_match.group(1)
188186
i = key_match.end()
189187
else:
190188
key = None
@@ -814,8 +812,8 @@ class _TypeableVisitor(ast.NodeVisitor):
814812
https://www.python.org/dev/peps/pep-0484/#type-comments
815813
"""
816814
def __init__(self):
817-
self.typeable_lines = [] # type: List[int]
818-
self.typeable_nodes = {} # type: Dict[int, ast.AST]
815+
self.typeable_lines = []
816+
self.typeable_nodes = {}
819817

820818
def _typeable(self, node):
821819
# if there is more than one typeable thing on a line last one wins

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ envlist =
44
py36,py37,py38,py39,py310,pypy3
55

66
[testenv]
7-
deps = flake8==3.6.0
7+
deps = flake8==4.0.1
88
setenv = PYFLAKES_ERROR_UNKNOWN=1
99
commands =
1010
python --version --version

0 commit comments

Comments
 (0)