PyCQA / pycodestyle

Simple Python style checker in one Python file
https://pycodestyle.pycqa.org
Other
5.01k stars 755 forks source link

Latest version doesn't seem to handle self-documenting f-string syntax added back in 3.8 #1224

Closed BrentWilkins closed 7 months ago

BrentWilkins commented 7 months ago

I have example.py:

var: int = 5
print(f'{var = }')

I'm running:

✗ flake8 --version
7.0.0 (mccabe: 0.7.0, pycodestyle: 2.11.1, pyflakes: 3.2.0) CPython 3.12.1 on [Darwin | Linux]

I get 3 errors for the valid syntax:

✗ flake8 example.py
example.py:3:13: E251 unexpected spaces around keyword / parameter equals
example.py:3:15: E202 whitespace before '}'
example.py:3:15: E251 unexpected spaces around keyword / parameter equals
asottile commented 7 months ago

please search for duplicates. the error there is intentional