flake8 7.1.2__tar.gz → 7.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {flake8-7.1.2/src/flake8.egg-info → flake8-7.3.0}/PKG-INFO +4 -4
- {flake8-7.1.2 → flake8-7.3.0}/setup.cfg +3 -3
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/__init__.py +1 -1
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/_compat.py +7 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/checker.py +7 -6
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/discover_files.py +4 -4
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/main/application.py +1 -1
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/main/cli.py +1 -1
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/options/aggregator.py +1 -1
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/options/manager.py +1 -1
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/options/parse_args.py +1 -1
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/plugins/finder.py +6 -6
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/plugins/pycodestyle.py +3 -3
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/plugins/pyflakes.py +4 -2
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/processor.py +20 -13
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/statistics.py +2 -2
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/style_guide.py +6 -12
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/utils.py +2 -2
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/violation.py +1 -1
- {flake8-7.1.2 → flake8-7.3.0/src/flake8.egg-info}/PKG-INFO +4 -4
- flake8-7.3.0/src/flake8.egg-info/requires.txt +3 -0
- flake8-7.1.2/src/flake8.egg-info/requires.txt +0 -3
- {flake8-7.1.2 → flake8-7.3.0}/LICENSE +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/README.rst +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/setup.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/__main__.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/api/__init__.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/api/legacy.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/defaults.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/exceptions.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/formatting/__init__.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/formatting/_windows_color.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/formatting/base.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/formatting/default.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/main/__init__.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/main/debug.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/main/options.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/options/__init__.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/options/config.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/plugins/__init__.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8/plugins/reporter.py +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8.egg-info/SOURCES.txt +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8.egg-info/dependency_links.txt +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8.egg-info/entry_points.txt +0 -0
- {flake8-7.1.2 → flake8-7.3.0}/src/flake8.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: flake8
|
|
3
|
-
Version: 7.
|
|
3
|
+
Version: 7.3.0
|
|
4
4
|
Summary: the modular source code checker: pep8 pyflakes and co
|
|
5
5
|
Home-page: https://github.com/pycqa/flake8
|
|
6
6
|
Author: Tarek Ziade
|
|
@@ -20,12 +20,12 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
|
20
20
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
21
21
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
22
|
Classifier: Topic :: Software Development :: Quality Assurance
|
|
23
|
-
Requires-Python: >=3.
|
|
23
|
+
Requires-Python: >=3.9
|
|
24
24
|
Description-Content-Type: text/x-rst
|
|
25
25
|
License-File: LICENSE
|
|
26
26
|
Requires-Dist: mccabe<0.8.0,>=0.7.0
|
|
27
|
-
Requires-Dist: pycodestyle<2.
|
|
28
|
-
Requires-Dist: pyflakes<3.
|
|
27
|
+
Requires-Dist: pycodestyle<2.15.0,>=2.14.0
|
|
28
|
+
Requires-Dist: pyflakes<3.5.0,>=3.4.0
|
|
29
29
|
|
|
30
30
|
.. image:: https://github.com/PyCQA/flake8/workflows/main/badge.svg
|
|
31
31
|
:target: https://github.com/PyCQA/flake8/actions?query=workflow%3Amain
|
|
@@ -29,9 +29,9 @@ classifiers =
|
|
|
29
29
|
packages = find:
|
|
30
30
|
install_requires =
|
|
31
31
|
mccabe>=0.7.0,<0.8.0
|
|
32
|
-
pycodestyle>=2.
|
|
33
|
-
pyflakes>=3.
|
|
34
|
-
python_requires = >=3.
|
|
32
|
+
pycodestyle>=2.14.0,<2.15.0
|
|
33
|
+
pyflakes>=3.4.0,<3.5.0
|
|
34
|
+
python_requires = >=3.9
|
|
35
35
|
package_dir =
|
|
36
36
|
=src
|
|
37
37
|
|
|
@@ -9,3 +9,10 @@ if sys.version_info >= (3, 12): # pragma: >=3.12 cover
|
|
|
9
9
|
FSTRING_END = tokenize.FSTRING_END
|
|
10
10
|
else: # pragma: <3.12 cover
|
|
11
11
|
FSTRING_START = FSTRING_MIDDLE = FSTRING_END = -1
|
|
12
|
+
|
|
13
|
+
if sys.version_info >= (3, 14): # pragma: >=3.14 cover
|
|
14
|
+
TSTRING_START = tokenize.TSTRING_START
|
|
15
|
+
TSTRING_MIDDLE = tokenize.TSTRING_MIDDLE
|
|
16
|
+
TSTRING_END = tokenize.TSTRING_END
|
|
17
|
+
else: # pragma: <3.14 cover
|
|
18
|
+
TSTRING_START = TSTRING_MIDDLE = TSTRING_END = -1
|
|
@@ -9,25 +9,24 @@ import multiprocessing.pool
|
|
|
9
9
|
import operator
|
|
10
10
|
import signal
|
|
11
11
|
import tokenize
|
|
12
|
+
from collections.abc import Generator
|
|
13
|
+
from collections.abc import Sequence
|
|
12
14
|
from typing import Any
|
|
13
|
-
from typing import Generator
|
|
14
|
-
from typing import List
|
|
15
15
|
from typing import Optional
|
|
16
|
-
from typing import Sequence
|
|
17
|
-
from typing import Tuple
|
|
18
16
|
|
|
19
17
|
from flake8 import defaults
|
|
20
18
|
from flake8 import exceptions
|
|
21
19
|
from flake8 import processor
|
|
22
20
|
from flake8 import utils
|
|
23
21
|
from flake8._compat import FSTRING_START
|
|
22
|
+
from flake8._compat import TSTRING_START
|
|
24
23
|
from flake8.discover_files import expand_paths
|
|
25
24
|
from flake8.options.parse_args import parse_args
|
|
26
25
|
from flake8.plugins.finder import Checkers
|
|
27
26
|
from flake8.plugins.finder import LoadedPlugin
|
|
28
27
|
from flake8.style_guide import StyleGuideManager
|
|
29
28
|
|
|
30
|
-
Results =
|
|
29
|
+
Results = list[tuple[str, int, int, str, Optional[str]]]
|
|
31
30
|
|
|
32
31
|
LOG = logging.getLogger(__name__)
|
|
33
32
|
|
|
@@ -53,7 +52,7 @@ _mp_options: argparse.Namespace
|
|
|
53
52
|
@contextlib.contextmanager
|
|
54
53
|
def _mp_prefork(
|
|
55
54
|
plugins: Checkers, options: argparse.Namespace
|
|
56
|
-
) -> Generator[None
|
|
55
|
+
) -> Generator[None]:
|
|
57
56
|
# we can save significant startup work w/ `fork` multiprocessing
|
|
58
57
|
global _mp_plugins, _mp_options
|
|
59
58
|
_mp_plugins, _mp_options = plugins, options
|
|
@@ -556,6 +555,8 @@ class FileChecker:
|
|
|
556
555
|
assert self.processor is not None
|
|
557
556
|
if token.type == FSTRING_START: # pragma: >=3.12 cover
|
|
558
557
|
self.processor.fstring_start(token.start[0])
|
|
558
|
+
elif token.type == TSTRING_START: # pragma: >=3.14 cover
|
|
559
|
+
self.processor.tstring_start(token.start[0])
|
|
559
560
|
# a newline token ends a single physical line.
|
|
560
561
|
elif processor.is_eol_token(token):
|
|
561
562
|
# if the file does not end with a newline, the NEWLINE
|
|
@@ -3,9 +3,9 @@ from __future__ import annotations
|
|
|
3
3
|
|
|
4
4
|
import logging
|
|
5
5
|
import os.path
|
|
6
|
+
from collections.abc import Generator
|
|
7
|
+
from collections.abc import Sequence
|
|
6
8
|
from typing import Callable
|
|
7
|
-
from typing import Generator
|
|
8
|
-
from typing import Sequence
|
|
9
9
|
|
|
10
10
|
from flake8 import utils
|
|
11
11
|
|
|
@@ -16,7 +16,7 @@ def _filenames_from(
|
|
|
16
16
|
arg: str,
|
|
17
17
|
*,
|
|
18
18
|
predicate: Callable[[str], bool],
|
|
19
|
-
) -> Generator[str
|
|
19
|
+
) -> Generator[str]:
|
|
20
20
|
"""Generate filenames from an argument.
|
|
21
21
|
|
|
22
22
|
:param arg:
|
|
@@ -55,7 +55,7 @@ def expand_paths(
|
|
|
55
55
|
stdin_display_name: str,
|
|
56
56
|
filename_patterns: Sequence[str],
|
|
57
57
|
exclude: Sequence[str],
|
|
58
|
-
) -> Generator[str
|
|
58
|
+
) -> Generator[str]:
|
|
59
59
|
"""Expand out ``paths`` from commandline to the lintable files."""
|
|
60
60
|
if not paths:
|
|
61
61
|
paths = ["."]
|
|
@@ -5,9 +5,9 @@ import argparse
|
|
|
5
5
|
import enum
|
|
6
6
|
import functools
|
|
7
7
|
import logging
|
|
8
|
+
from collections.abc import Sequence
|
|
8
9
|
from typing import Any
|
|
9
10
|
from typing import Callable
|
|
10
|
-
from typing import Sequence
|
|
11
11
|
|
|
12
12
|
from flake8 import utils
|
|
13
13
|
from flake8.plugins.finder import Plugins
|
|
@@ -7,9 +7,9 @@ import inspect
|
|
|
7
7
|
import itertools
|
|
8
8
|
import logging
|
|
9
9
|
import sys
|
|
10
|
+
from collections.abc import Generator
|
|
11
|
+
from collections.abc import Iterable
|
|
10
12
|
from typing import Any
|
|
11
|
-
from typing import Generator
|
|
12
|
-
from typing import Iterable
|
|
13
13
|
from typing import NamedTuple
|
|
14
14
|
|
|
15
15
|
from flake8 import utils
|
|
@@ -68,7 +68,7 @@ class Plugins(NamedTuple):
|
|
|
68
68
|
reporters: dict[str, LoadedPlugin]
|
|
69
69
|
disabled: list[LoadedPlugin]
|
|
70
70
|
|
|
71
|
-
def all_plugins(self) -> Generator[LoadedPlugin
|
|
71
|
+
def all_plugins(self) -> Generator[LoadedPlugin]:
|
|
72
72
|
"""Return an iterator over all :class:`LoadedPlugin`s."""
|
|
73
73
|
yield from self.checkers.tree
|
|
74
74
|
yield from self.checkers.logical_line
|
|
@@ -151,7 +151,7 @@ def _flake8_plugins(
|
|
|
151
151
|
eps: Iterable[importlib.metadata.EntryPoint],
|
|
152
152
|
name: str,
|
|
153
153
|
version: str,
|
|
154
|
-
) -> Generator[Plugin
|
|
154
|
+
) -> Generator[Plugin]:
|
|
155
155
|
pyflakes_meta = importlib.metadata.distribution("pyflakes").metadata
|
|
156
156
|
pycodestyle_meta = importlib.metadata.distribution("pycodestyle").metadata
|
|
157
157
|
|
|
@@ -173,7 +173,7 @@ def _flake8_plugins(
|
|
|
173
173
|
yield Plugin(name, version, ep)
|
|
174
174
|
|
|
175
175
|
|
|
176
|
-
def _find_importlib_plugins() -> Generator[Plugin
|
|
176
|
+
def _find_importlib_plugins() -> Generator[Plugin]:
|
|
177
177
|
# some misconfigured pythons (RHEL) have things on `sys.path` twice
|
|
178
178
|
seen = set()
|
|
179
179
|
for dist in importlib.metadata.distributions():
|
|
@@ -212,7 +212,7 @@ def _find_importlib_plugins() -> Generator[Plugin, None, None]:
|
|
|
212
212
|
|
|
213
213
|
def _find_local_plugins(
|
|
214
214
|
cfg: configparser.RawConfigParser,
|
|
215
|
-
) -> Generator[Plugin
|
|
215
|
+
) -> Generator[Plugin]:
|
|
216
216
|
for plugin_type in ("extension", "report"):
|
|
217
217
|
group = f"flake8.{plugin_type}"
|
|
218
218
|
for plugin_s in utils.parse_comma_separated_list(
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
# fmt: off
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from collections.abc import Generator
|
|
5
6
|
from typing import Any
|
|
6
|
-
from typing import Generator
|
|
7
7
|
|
|
8
8
|
from pycodestyle import ambiguous_identifier as _ambiguous_identifier
|
|
9
9
|
from pycodestyle import bare_except as _bare_except
|
|
@@ -55,7 +55,7 @@ def pycodestyle_logical(
|
|
|
55
55
|
previous_unindented_logical_line: Any,
|
|
56
56
|
tokens: Any,
|
|
57
57
|
verbose: Any,
|
|
58
|
-
) -> Generator[tuple[int, str]
|
|
58
|
+
) -> Generator[tuple[int, str]]:
|
|
59
59
|
"""Run pycodestyle logical checks."""
|
|
60
60
|
yield from _ambiguous_identifier(logical_line, tokens)
|
|
61
61
|
yield from _bare_except(logical_line, noqa)
|
|
@@ -93,7 +93,7 @@ def pycodestyle_physical(
|
|
|
93
93
|
noqa: Any,
|
|
94
94
|
physical_line: Any,
|
|
95
95
|
total_lines: Any,
|
|
96
|
-
) -> Generator[tuple[int, str]
|
|
96
|
+
) -> Generator[tuple[int, str]]:
|
|
97
97
|
"""Run pycodestyle physical checks."""
|
|
98
98
|
ret = _maximum_line_length(physical_line, max_line_length, multiline, line_number, noqa) # noqa: E501
|
|
99
99
|
if ret is not None:
|
|
@@ -4,8 +4,8 @@ from __future__ import annotations
|
|
|
4
4
|
import argparse
|
|
5
5
|
import ast
|
|
6
6
|
import logging
|
|
7
|
+
from collections.abc import Generator
|
|
7
8
|
from typing import Any
|
|
8
|
-
from typing import Generator
|
|
9
9
|
|
|
10
10
|
import pyflakes.checker
|
|
11
11
|
|
|
@@ -36,6 +36,7 @@ FLAKE8_PYFLAKES_CODES = {
|
|
|
36
36
|
"StringDotFormatMissingArgument": "F524",
|
|
37
37
|
"StringDotFormatMixingAutomatic": "F525",
|
|
38
38
|
"FStringMissingPlaceholders": "F541",
|
|
39
|
+
"TStringMissingPlaceholders": "F542",
|
|
39
40
|
"MultiValueRepeatedKeyLiteral": "F601",
|
|
40
41
|
"MultiValueRepeatedKeyVariable": "F602",
|
|
41
42
|
"TooManyExpressionsInStarredAssignment": "F621",
|
|
@@ -55,6 +56,7 @@ FLAKE8_PYFLAKES_CODES = {
|
|
|
55
56
|
"UndefinedName": "F821",
|
|
56
57
|
"UndefinedExport": "F822",
|
|
57
58
|
"UndefinedLocal": "F823",
|
|
59
|
+
"UnusedIndirectAssignment": "F824",
|
|
58
60
|
"DuplicateArgument": "F831",
|
|
59
61
|
"UnusedVariable": "F841",
|
|
60
62
|
"UnusedAnnotation": "F842",
|
|
@@ -97,7 +99,7 @@ class FlakesChecker(pyflakes.checker.Checker):
|
|
|
97
99
|
cls.builtIns = cls.builtIns.union(options.builtins)
|
|
98
100
|
cls.with_doctest = options.doctests
|
|
99
101
|
|
|
100
|
-
def run(self) -> Generator[tuple[int, int, str, type[Any]]
|
|
102
|
+
def run(self) -> Generator[tuple[int, int, str, type[Any]]]:
|
|
101
103
|
"""Run the plugin."""
|
|
102
104
|
for message in self.messages:
|
|
103
105
|
col = getattr(message, "col", 0)
|
|
@@ -6,15 +6,15 @@ import ast
|
|
|
6
6
|
import functools
|
|
7
7
|
import logging
|
|
8
8
|
import tokenize
|
|
9
|
+
from collections.abc import Generator
|
|
9
10
|
from typing import Any
|
|
10
|
-
from typing import Generator
|
|
11
|
-
from typing import List
|
|
12
|
-
from typing import Tuple
|
|
13
11
|
|
|
14
12
|
from flake8 import defaults
|
|
15
13
|
from flake8 import utils
|
|
16
14
|
from flake8._compat import FSTRING_END
|
|
17
15
|
from flake8._compat import FSTRING_MIDDLE
|
|
16
|
+
from flake8._compat import TSTRING_END
|
|
17
|
+
from flake8._compat import TSTRING_MIDDLE
|
|
18
18
|
from flake8.plugins.finder import LoadedPlugin
|
|
19
19
|
|
|
20
20
|
LOG = logging.getLogger(__name__)
|
|
@@ -24,8 +24,8 @@ SKIP_TOKENS = frozenset(
|
|
|
24
24
|
[tokenize.NL, tokenize.NEWLINE, tokenize.INDENT, tokenize.DEDENT]
|
|
25
25
|
)
|
|
26
26
|
|
|
27
|
-
_LogicalMapping =
|
|
28
|
-
_Logical =
|
|
27
|
+
_LogicalMapping = list[tuple[int, tuple[int, int]]]
|
|
28
|
+
_Logical = tuple[list[str], list[str], _LogicalMapping]
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
class FileProcessor:
|
|
@@ -115,7 +115,7 @@ class FileProcessor:
|
|
|
115
115
|
self.verbose = options.verbose
|
|
116
116
|
#: Statistics dictionary
|
|
117
117
|
self.statistics = {"logical lines": 0}
|
|
118
|
-
self._fstring_start = -1
|
|
118
|
+
self._fstring_start = self._tstring_start = -1
|
|
119
119
|
|
|
120
120
|
@functools.cached_property
|
|
121
121
|
def file_tokens(self) -> list[tokenize.TokenInfo]:
|
|
@@ -127,12 +127,16 @@ class FileProcessor:
|
|
|
127
127
|
"""Signal the beginning of an fstring."""
|
|
128
128
|
self._fstring_start = lineno
|
|
129
129
|
|
|
130
|
-
def
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
def tstring_start(self, lineno: int) -> None: # pragma: >=3.14 cover
|
|
131
|
+
"""Signal the beginning of an tstring."""
|
|
132
|
+
self._tstring_start = lineno
|
|
133
|
+
|
|
134
|
+
def multiline_string(self, token: tokenize.TokenInfo) -> Generator[str]:
|
|
133
135
|
"""Iterate through the lines of a multiline string."""
|
|
134
136
|
if token.type == FSTRING_END: # pragma: >=3.12 cover
|
|
135
137
|
start = self._fstring_start
|
|
138
|
+
elif token.type == TSTRING_END: # pragma: >=3.14 cover
|
|
139
|
+
start = self._tstring_start
|
|
136
140
|
else:
|
|
137
141
|
start = token.start[0]
|
|
138
142
|
|
|
@@ -202,7 +206,10 @@ class FileProcessor:
|
|
|
202
206
|
continue
|
|
203
207
|
if token_type == tokenize.STRING:
|
|
204
208
|
text = mutate_string(text)
|
|
205
|
-
elif token_type
|
|
209
|
+
elif token_type in {
|
|
210
|
+
FSTRING_MIDDLE,
|
|
211
|
+
TSTRING_MIDDLE,
|
|
212
|
+
}: # pragma: >=3.12 cover # noqa: E501
|
|
206
213
|
# A curly brace in an FSTRING_MIDDLE token must be an escaped
|
|
207
214
|
# curly brace. Both 'text' and 'end' will account for the
|
|
208
215
|
# escaped version of the token (i.e. a single brace) rather
|
|
@@ -210,7 +217,7 @@ class FileProcessor:
|
|
|
210
217
|
brace_offset = text.count("{") + text.count("}")
|
|
211
218
|
text = "x" * (len(text) + brace_offset)
|
|
212
219
|
end = (end[0], end[1] + brace_offset)
|
|
213
|
-
if previous_row:
|
|
220
|
+
if previous_row is not None and previous_column is not None:
|
|
214
221
|
(start_row, start_column) = start
|
|
215
222
|
if previous_row != start_row:
|
|
216
223
|
row_index = previous_row - 1
|
|
@@ -263,7 +270,7 @@ class FileProcessor:
|
|
|
263
270
|
)
|
|
264
271
|
return ret
|
|
265
272
|
|
|
266
|
-
def generate_tokens(self) -> Generator[tokenize.TokenInfo
|
|
273
|
+
def generate_tokens(self) -> Generator[tokenize.TokenInfo]:
|
|
267
274
|
"""Tokenize the file and yield the tokens."""
|
|
268
275
|
for token in tokenize.generate_tokens(self.next_line):
|
|
269
276
|
if token[2][0] > self.total_lines:
|
|
@@ -386,7 +393,7 @@ def is_eol_token(token: tokenize.TokenInfo) -> bool:
|
|
|
386
393
|
|
|
387
394
|
def is_multiline_string(token: tokenize.TokenInfo) -> bool:
|
|
388
395
|
"""Check if this is a multiline string."""
|
|
389
|
-
return token.type
|
|
396
|
+
return token.type in {FSTRING_END, TSTRING_END} or (
|
|
390
397
|
token.type == tokenize.STRING and "\n" in token.string
|
|
391
398
|
)
|
|
392
399
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Statistic collection logic for Flake8."""
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
-
from
|
|
4
|
+
from collections.abc import Generator
|
|
5
5
|
from typing import NamedTuple
|
|
6
6
|
|
|
7
7
|
from flake8.violation import Violation
|
|
@@ -36,7 +36,7 @@ class Statistics:
|
|
|
36
36
|
|
|
37
37
|
def statistics_for(
|
|
38
38
|
self, prefix: str, filename: str | None = None
|
|
39
|
-
) -> Generator[Statistic
|
|
39
|
+
) -> Generator[Statistic]:
|
|
40
40
|
"""Generate statistics for the prefix and filename.
|
|
41
41
|
|
|
42
42
|
If you have a :class:`Statistics` object that has recorded errors,
|
|
@@ -7,8 +7,8 @@ import copy
|
|
|
7
7
|
import enum
|
|
8
8
|
import functools
|
|
9
9
|
import logging
|
|
10
|
-
from
|
|
11
|
-
from
|
|
10
|
+
from collections.abc import Generator
|
|
11
|
+
from collections.abc import Sequence
|
|
12
12
|
|
|
13
13
|
from flake8 import defaults
|
|
14
14
|
from flake8 import statistics
|
|
@@ -225,13 +225,11 @@ class StyleGuideManager:
|
|
|
225
225
|
*self.populate_style_guides_with(options),
|
|
226
226
|
]
|
|
227
227
|
|
|
228
|
-
self.style_guide_for = functools.
|
|
229
|
-
self._style_guide_for
|
|
230
|
-
)
|
|
228
|
+
self.style_guide_for = functools.cache(self._style_guide_for)
|
|
231
229
|
|
|
232
230
|
def populate_style_guides_with(
|
|
233
231
|
self, options: argparse.Namespace
|
|
234
|
-
) -> Generator[StyleGuide
|
|
232
|
+
) -> Generator[StyleGuide]:
|
|
235
233
|
"""Generate style guides from the per-file-ignores option.
|
|
236
234
|
|
|
237
235
|
:param options:
|
|
@@ -253,9 +251,7 @@ class StyleGuideManager:
|
|
|
253
251
|
)
|
|
254
252
|
|
|
255
253
|
@contextlib.contextmanager
|
|
256
|
-
def processing_file(
|
|
257
|
-
self, filename: str
|
|
258
|
-
) -> Generator[StyleGuide, None, None]:
|
|
254
|
+
def processing_file(self, filename: str) -> Generator[StyleGuide]:
|
|
259
255
|
"""Record the fact that we're processing the file's results."""
|
|
260
256
|
guide = self.style_guide_for(filename)
|
|
261
257
|
with guide.processing_file(filename):
|
|
@@ -338,9 +334,7 @@ class StyleGuide:
|
|
|
338
334
|
)
|
|
339
335
|
|
|
340
336
|
@contextlib.contextmanager
|
|
341
|
-
def processing_file(
|
|
342
|
-
self, filename: str
|
|
343
|
-
) -> Generator[StyleGuide, None, None]:
|
|
337
|
+
def processing_file(self, filename: str) -> Generator[StyleGuide]:
|
|
344
338
|
"""Record the fact that we're processing the file's results."""
|
|
345
339
|
self.formatter.beginning(filename)
|
|
346
340
|
yield self
|
|
@@ -11,9 +11,9 @@ import re
|
|
|
11
11
|
import sys
|
|
12
12
|
import textwrap
|
|
13
13
|
import tokenize
|
|
14
|
+
from collections.abc import Sequence
|
|
15
|
+
from re import Pattern
|
|
14
16
|
from typing import NamedTuple
|
|
15
|
-
from typing import Pattern
|
|
16
|
-
from typing import Sequence
|
|
17
17
|
|
|
18
18
|
from flake8 import exceptions
|
|
19
19
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: flake8
|
|
3
|
-
Version: 7.
|
|
3
|
+
Version: 7.3.0
|
|
4
4
|
Summary: the modular source code checker: pep8 pyflakes and co
|
|
5
5
|
Home-page: https://github.com/pycqa/flake8
|
|
6
6
|
Author: Tarek Ziade
|
|
@@ -20,12 +20,12 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
|
20
20
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
21
21
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
22
|
Classifier: Topic :: Software Development :: Quality Assurance
|
|
23
|
-
Requires-Python: >=3.
|
|
23
|
+
Requires-Python: >=3.9
|
|
24
24
|
Description-Content-Type: text/x-rst
|
|
25
25
|
License-File: LICENSE
|
|
26
26
|
Requires-Dist: mccabe<0.8.0,>=0.7.0
|
|
27
|
-
Requires-Dist: pycodestyle<2.
|
|
28
|
-
Requires-Dist: pyflakes<3.
|
|
27
|
+
Requires-Dist: pycodestyle<2.15.0,>=2.14.0
|
|
28
|
+
Requires-Dist: pyflakes<3.5.0,>=3.4.0
|
|
29
29
|
|
|
30
30
|
.. image:: https://github.com/PyCQA/flake8/workflows/main/badge.svg
|
|
31
31
|
:target: https://github.com/PyCQA/flake8/actions?query=workflow%3Amain
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|