Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PyCQA/flake8
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7.1.0
Choose a base ref
...
head repository: PyCQA/flake8
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7.1.1
Choose a head ref
  • 5 commits
  • 6 files changed
  • 4 contributors

Commits on Jul 23, 2024

  1. Configuration menu
    Copy the full SHA
    10314ad View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1946 from Viicos/patch-1

    Fix wording of plugins documentation
    sigmavirus24 authored Jul 23, 2024
    Configuration menu
    Copy the full SHA
    2a811cc View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2024

  1. Handle escaped braces in f-strings

    To use a curly brace in an f-string, you must escape it. For example:
    
      >>> k = 1
      >>> f'{{{k}'
      '{1'
    
    Saving this as a script and running the 'tokenize' module highlights
    something odd around the counting of tokens:
    
      ❯ python -m tokenize wow.py
      0,0-0,0:            ENCODING       'utf-8'
      1,0-1,1:            NAME           'k'
      1,2-1,3:            OP             '='
      1,4-1,5:            NUMBER         '1'
      1,5-1,6:            NEWLINE        '\n'
      2,0-2,2:            FSTRING_START  "f'"
      2,2-2,3:            FSTRING_MIDDLE '{'     # <-- here...
      2,4-2,5:            OP             '{'     # <-- and here
      2,5-2,6:            NAME           'k'
      2,6-2,7:            OP             '}'
      2,7-2,8:            FSTRING_END    "'"
      2,8-2,9:            NEWLINE        '\n'
      3,0-3,0:            ENDMARKER      ''
    
    The FSTRING_MIDDLE character we have is the escaped/post-parse single
    curly brace rather than the raw double curly brace, however, while our
    end index of this token accounts for the parsed form, the start index of
    the next token does not (put another way, it jumps from 3 -> 4). This
    triggers some existing, unrelated code that we need to bypass. Do just
    that.
    
    Signed-off-by: Stephen Finucane <[email protected]>
    Closes: #1948
    stephenfin authored and asottile committed Aug 4, 2024
    Configuration menu
    Copy the full SHA
    bdcd5c2 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1949 from stephenfin/issue-1948

    Handle escaped braces in f-strings
    asottile authored Aug 4, 2024
    Configuration menu
    Copy the full SHA
    939ea3d View commit details
    Browse the repository at this point in the history
  3. Release 7.1.1

    asottile committed Aug 4, 2024
    Configuration menu
    Copy the full SHA
    cf1542c View commit details
    Browse the repository at this point in the history
Loading