flake8 7.2.0__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.
Files changed (45) hide show
  1. {flake8-7.2.0/src/flake8.egg-info → flake8-7.3.0}/PKG-INFO +3 -3
  2. {flake8-7.2.0 → flake8-7.3.0}/setup.cfg +2 -2
  3. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/__init__.py +1 -1
  4. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/_compat.py +7 -0
  5. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/checker.py +3 -0
  6. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/plugins/pyflakes.py +1 -0
  7. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/processor.py +14 -3
  8. {flake8-7.2.0 → flake8-7.3.0/src/flake8.egg-info}/PKG-INFO +3 -3
  9. flake8-7.3.0/src/flake8.egg-info/requires.txt +3 -0
  10. flake8-7.2.0/src/flake8.egg-info/requires.txt +0 -3
  11. {flake8-7.2.0 → flake8-7.3.0}/LICENSE +0 -0
  12. {flake8-7.2.0 → flake8-7.3.0}/README.rst +0 -0
  13. {flake8-7.2.0 → flake8-7.3.0}/setup.py +0 -0
  14. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/__main__.py +0 -0
  15. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/api/__init__.py +0 -0
  16. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/api/legacy.py +0 -0
  17. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/defaults.py +0 -0
  18. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/discover_files.py +0 -0
  19. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/exceptions.py +0 -0
  20. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/formatting/__init__.py +0 -0
  21. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/formatting/_windows_color.py +0 -0
  22. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/formatting/base.py +0 -0
  23. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/formatting/default.py +0 -0
  24. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/main/__init__.py +0 -0
  25. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/main/application.py +0 -0
  26. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/main/cli.py +0 -0
  27. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/main/debug.py +0 -0
  28. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/main/options.py +0 -0
  29. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/options/__init__.py +0 -0
  30. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/options/aggregator.py +0 -0
  31. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/options/config.py +0 -0
  32. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/options/manager.py +0 -0
  33. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/options/parse_args.py +0 -0
  34. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/plugins/__init__.py +0 -0
  35. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/plugins/finder.py +0 -0
  36. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/plugins/pycodestyle.py +0 -0
  37. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/plugins/reporter.py +0 -0
  38. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/statistics.py +0 -0
  39. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/style_guide.py +0 -0
  40. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/utils.py +0 -0
  41. {flake8-7.2.0 → flake8-7.3.0}/src/flake8/violation.py +0 -0
  42. {flake8-7.2.0 → flake8-7.3.0}/src/flake8.egg-info/SOURCES.txt +0 -0
  43. {flake8-7.2.0 → flake8-7.3.0}/src/flake8.egg-info/dependency_links.txt +0 -0
  44. {flake8-7.2.0 → flake8-7.3.0}/src/flake8.egg-info/entry_points.txt +0 -0
  45. {flake8-7.2.0 → 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.2.0
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
@@ -24,8 +24,8 @@ 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.14.0,>=2.13.0
28
- Requires-Dist: pyflakes<3.4.0,>=3.3.0
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,8 +29,8 @@ classifiers =
29
29
  packages = find:
30
30
  install_requires =
31
31
  mccabe>=0.7.0,<0.8.0
32
- pycodestyle>=2.13.0,<2.14.0
33
- pyflakes>=3.3.0,<3.4.0
32
+ pycodestyle>=2.14.0,<2.15.0
33
+ pyflakes>=3.4.0,<3.5.0
34
34
  python_requires = >=3.9
35
35
  package_dir =
36
36
  =src
@@ -17,7 +17,7 @@ import sys
17
17
  LOG = logging.getLogger(__name__)
18
18
  LOG.addHandler(logging.NullHandler())
19
19
 
20
- __version__ = "7.2.0"
20
+ __version__ = "7.3.0"
21
21
  __version_info__ = tuple(int(i) for i in __version__.split(".") if i.isdigit())
22
22
 
23
23
  _VERBOSITY_TO_LOG_LEVEL = {
@@ -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
@@ -19,6 +19,7 @@ from flake8 import exceptions
19
19
  from flake8 import processor
20
20
  from flake8 import utils
21
21
  from flake8._compat import FSTRING_START
22
+ from flake8._compat import TSTRING_START
22
23
  from flake8.discover_files import expand_paths
23
24
  from flake8.options.parse_args import parse_args
24
25
  from flake8.plugins.finder import Checkers
@@ -554,6 +555,8 @@ class FileChecker:
554
555
  assert self.processor is not None
555
556
  if token.type == FSTRING_START: # pragma: >=3.12 cover
556
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])
557
560
  # a newline token ends a single physical line.
558
561
  elif processor.is_eol_token(token):
559
562
  # if the file does not end with a newline, the NEWLINE
@@ -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",
@@ -13,6 +13,8 @@ from flake8 import defaults
13
13
  from flake8 import utils
14
14
  from flake8._compat import FSTRING_END
15
15
  from flake8._compat import FSTRING_MIDDLE
16
+ from flake8._compat import TSTRING_END
17
+ from flake8._compat import TSTRING_MIDDLE
16
18
  from flake8.plugins.finder import LoadedPlugin
17
19
 
18
20
  LOG = logging.getLogger(__name__)
@@ -113,7 +115,7 @@ class FileProcessor:
113
115
  self.verbose = options.verbose
114
116
  #: Statistics dictionary
115
117
  self.statistics = {"logical lines": 0}
116
- self._fstring_start = -1
118
+ self._fstring_start = self._tstring_start = -1
117
119
 
118
120
  @functools.cached_property
119
121
  def file_tokens(self) -> list[tokenize.TokenInfo]:
@@ -125,10 +127,16 @@ class FileProcessor:
125
127
  """Signal the beginning of an fstring."""
126
128
  self._fstring_start = lineno
127
129
 
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
+
128
134
  def multiline_string(self, token: tokenize.TokenInfo) -> Generator[str]:
129
135
  """Iterate through the lines of a multiline string."""
130
136
  if token.type == FSTRING_END: # pragma: >=3.12 cover
131
137
  start = self._fstring_start
138
+ elif token.type == TSTRING_END: # pragma: >=3.14 cover
139
+ start = self._tstring_start
132
140
  else:
133
141
  start = token.start[0]
134
142
 
@@ -198,7 +206,10 @@ class FileProcessor:
198
206
  continue
199
207
  if token_type == tokenize.STRING:
200
208
  text = mutate_string(text)
201
- elif token_type == FSTRING_MIDDLE: # pragma: >=3.12 cover
209
+ elif token_type in {
210
+ FSTRING_MIDDLE,
211
+ TSTRING_MIDDLE,
212
+ }: # pragma: >=3.12 cover # noqa: E501
202
213
  # A curly brace in an FSTRING_MIDDLE token must be an escaped
203
214
  # curly brace. Both 'text' and 'end' will account for the
204
215
  # escaped version of the token (i.e. a single brace) rather
@@ -382,7 +393,7 @@ def is_eol_token(token: tokenize.TokenInfo) -> bool:
382
393
 
383
394
  def is_multiline_string(token: tokenize.TokenInfo) -> bool:
384
395
  """Check if this is a multiline string."""
385
- return token.type == FSTRING_END or (
396
+ return token.type in {FSTRING_END, TSTRING_END} or (
386
397
  token.type == tokenize.STRING and "\n" in token.string
387
398
  )
388
399
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flake8
3
- Version: 7.2.0
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
@@ -24,8 +24,8 @@ 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.14.0,>=2.13.0
28
- Requires-Dist: pyflakes<3.4.0,>=3.3.0
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
@@ -0,0 +1,3 @@
1
+ mccabe<0.8.0,>=0.7.0
2
+ pycodestyle<2.15.0,>=2.14.0
3
+ pyflakes<3.5.0,>=3.4.0
@@ -1,3 +0,0 @@
1
- mccabe<0.8.0,>=0.7.0
2
- pycodestyle<2.14.0,>=2.13.0
3
- pyflakes<3.4.0,>=3.3.0
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