Skip to content
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

upgrade flake8 to 4.0.1 #706

Merged
merged 1 commit into from May 30, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 4 additions & 6 deletions pyflakes/checker.py
Expand Up @@ -151,20 +151,18 @@ def _is_name_or_attr(node, name): # type: (ast.AST, str) -> bool


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


def parse_percent_format(s): # type: (str) -> Tuple[PercentFormat, ...]
def parse_percent_format(s):
"""Parses the string component of a `'...' % ...` format call

Copied from https://github.com/asottile/pyupgrade at v1.20.1
"""

def _parse_inner():
# type: () -> Generator[PercentFormat, None, None]
string_start = 0
string_end = 0
in_fmt = False
Expand All @@ -184,7 +182,7 @@ def _parse_inner():
else:
key_match = MAPPING_KEY_RE.match(s, i)
if key_match:
key = key_match.group(1) # type: Optional[str]
key = key_match.group(1)
i = key_match.end()
else:
key = None
Expand Down Expand Up @@ -814,8 +812,8 @@ class _TypeableVisitor(ast.NodeVisitor):
https://www.python.org/dev/peps/pep-0484/#type-comments
"""
def __init__(self):
self.typeable_lines = [] # type: List[int]
self.typeable_nodes = {} # type: Dict[int, ast.AST]
self.typeable_lines = []
self.typeable_nodes = {}

def _typeable(self, node):
# if there is more than one typeable thing on a line last one wins
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -4,7 +4,7 @@ envlist =
py36,py37,py38,py39,py310,pypy3

[testenv]
deps = flake8==3.6.0
deps = flake8==4.0.1
setenv = PYFLAKES_ERROR_UNKNOWN=1
commands =
python --version --version
Expand Down