James's Ramblings

Python: Pylint

Created: September 05, 2020

Generate a .pylintrc:

pylint --generate-rcfile > $HOME/.pylintrc

Enabling/Disabling Checks

  • Pylint is too opinionated by default and tries to suggest restrictive design changes that don’t actually make much sense in specific contexts.

  • Unwanted checks can be disabled in pylintrc.

  • The enable= and disable= sections take a comma-separated list of checks to disable.

  • Pylink check reference.

  • disable=all can be used to disable everything then enable it selectively.

  • Current disabled checks:

    disable=unused-variable,
    too-many-branches,
    too-many-public-methods,
    too-many-instance-attributes,
    missing-function-docstring
    

Getting Help

pylint --help-msg=ERROR_MESSAGE

Example:

pylint --help-msg=anomalous-backslash-in-string