Skip to content

Instantly share code, notes, and snippets.

@Integralist
Last active October 31, 2022 14:19
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Integralist/a93f6dfe7e1b948666272fd2e64db466 to your computer and use it in GitHub Desktop.
Save Integralist/a93f6dfe7e1b948666272fd2e64db466 to your computer and use it in GitHub Desktop.
[Python ignore pylint and flake8 linter errors] #tags: python, linter, ignore, pylint, flake8

Disable all linting across the entire file:

# pylint: disable-all (older)
# pylint: skip-file   (newer)
# flake8: noqa

Disable specific linting errors across the entire file:

# pylint: disable=123

Note: flake8 can't do this, unless you use something like tox.ini
So by adding ignore = F403,E501 in a [flake8] section of setup.cfg or tox.ini I've also seen this to be configurable with a .flake8 file instead of a tox.ini

Disable specific linting errors for specific lines:

some_code  # noqa: E731,E123
some_code  # noqa pylint: disable=unused-import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment