I use flake8 as python linter in vscode. I want flake8 to ignore all warning, but I can't find any option to detect error-only
after searching flake8 documentation. So, how can I achieve this? Any help?
though flake8 has things that are marked "E" and "F" and "W" they don't stand for "error" / "failure" / "warning". these are codes for particular plugins ("E" / "W" are pycodestyle, "F" is pyflakes)
if you want to exclude a particular set of warnings, you'd use the --extend-ignore=X
argument (or the --ignore=X
argument, though the former is preferable since it doesn't reset the default set of ignores).
It's usually easier to set this in a flake8 configuration file (tox.ini
/ setup.cfg
/ .flake8
) such that others can take advantage of this setting without needing to use your IDE-specific setting.
[flake8]
extend-ignore = X, Y, Z
If you know you only want a particular set of codes, you can also utilize --select
[flake8]
select = F,E
disclaimer: I am the current maintainer of flake8
Add following settings to settings.json:
Ignore warnings:
"python.linting.flake8Args": ["--ignore=W"]
, though this will leave other codes. https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-selectShow only errors:
"python.linting.flake8Args": ["--select=E"]
© 2022 - 2024 — McMap. All rights reserved.
E
does not mean error? – Krystinakrystle