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

f-string like f"{foo = }" is detected as an error #1886

Closed
jfcherng opened this issue Nov 8, 2023 · 1 comment
Closed

f-string like f"{foo = }" is detected as an error #1886

jfcherng opened this issue Nov 8, 2023 · 1 comment

Comments

@jfcherng
Copy link

jfcherng commented Nov 8, 2023

how did you install flake8?

[jfcherng@jfcherng-vm Desktop]$ python -m pip install -U flake8                                          
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: flake8 in /home/jfcherng/.local/lib/python3.12/site-packages (6.1.0)
Requirement already satisfied: mccabe<0.8.0,>=0.7.0 in /home/jfcherng/.local/lib/python3.12/site-packages (from flake8) (0.7.0)
Requirement already satisfied: pycodestyle<2.12.0,>=2.11.0 in /home/jfcherng/.local/lib/python3.12/site-packages (from flake8) (2.11.1)
Requirement already satisfied: pyflakes<3.2.0,>=3.1.0 in /home/jfcherng/.local/lib/python3.12/site-packages (from flake8) (3.1.0)

unmodified output of flake8 --bug-report

{
  "platform": {
    "python_implementation": "CPython",
    "python_version": "3.12.0",
    "system": "Linux"
  },
  "plugins": [
    {
      "plugin": "mccabe",
      "version": "0.7.0"
    },
    {
      "plugin": "pycodestyle",
      "version": "2.11.1"
    },
    {
      "plugin": "pyflakes",
      "version": "3.1.0"
    }
  ],
  "version": "6.1.0"
}

describe the problem

what I expected to happen

Expect no error but I get

[jfcherng@jfcherng-vm Desktop]$ flake8 test.py 
test.py:2:13: E251 unexpected spaces around keyword / parameter equals
test.py:2:15: E202 whitespace before '}'
test.py:2:15: E251 unexpected spaces around keyword / parameter equals

sample code

foo = "bar"
print(f"{foo = }")

commands ran

$ flake8 test.py
@sigmavirus24
Copy link
Member

Flake8 doesn't implement checks itself. It's documented in the issue template

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants