How do I get flake8 to reliably ignore rules in VS Code?
Add your arguments to your USER SETTINGS json file like this: “python.linting.flake8Args”: [ “–max-line-length=120”, “–ignore=E402,F841,F401,E302,E305”, ],
Add your arguments to your USER SETTINGS json file like this: “python.linting.flake8Args”: [ “–max-line-length=120”, “–ignore=E402,F841,F401,E302,E305”, ],
As of Flake8 3.7.0 you can do this using the –per-file-ignores option. Command line example flake8 –per-file-ignores=”project/__init__.py:F401 setup.py:E121″ Or in your config file per-file-ignores = project/__init__.py:F401 setup.py:E121 other_project/*:W9 See the documentation here: http://flake8.pycqa.org/en/latest/user/options.html?highlight=per-file-ignores#cmdoption-flake8-per-file-ignores It is not possible to place a noqa comment for specific codes at the top of a file like you can for … Read more
The recommendation in PEP-8 you are running into is: Always use a def statement instead of an assignment statement that binds a lambda expression directly to a name. Yes: def f(x): return 2*x No: f = lambda x: 2*x The first form means that the name of the resulting function object is specifically ‘f’ instead … Read more