Go to file
2022-12-27 00:04:56 +01:00
.github Bump actions/setup-python from 4.3.1 to 4.4.0 (#7984) 2022-12-26 13:49:11 +00:00
doc Fix use-sequence-for-iteration when unpacking a set with * (#7975) 2022-12-26 09:37:58 -05:00
examples [pre-commit] Upgrade to black 23.1a1 with 2023's formatting (#7965) 2022-12-27 00:04:56 +01:00
pylint [pre-commit] Upgrade to black 23.1a1 with 2023's formatting (#7965) 2022-12-27 00:04:56 +01:00
script
tests [pre-commit] Upgrade to black 23.1a1 with 2023's formatting (#7965) 2022-12-27 00:04:56 +01:00
.coveragerc
.gitignore
.pre-commit-config.yaml [pre-commit] Upgrade to black 23.1a1 with 2023's formatting (#7965) 2022-12-27 00:04:56 +01:00
.pre-commit-hooks.yaml
.pyenchant_pylint_custom_dict.txt
.readthedocs.yaml
CODE_OF_CONDUCT.md
CONTRIBUTORS.txt
Dockerfile
LICENSE
MANIFEST.in
pylintrc
pyproject.toml fix: bump dill to >= 0.3.6, prevents tests hanging with python3.11 (#7918) 2022-12-14 19:43:59 +01:00
README.rst [packaging] Remove a sphinx only reference from the Readme 2022-12-08 16:52:29 +01:00
requirements_test_min.txt Update towncrier requirement from ~=22.8 to ~=22.12 (#7986) 2022-12-26 14:04:53 +00:00
requirements_test_pre_commit.txt [pre-commit] Upgrade to black 23.1a1 with 2023's formatting (#7965) 2022-12-27 00:04:56 +01:00
requirements_test.txt Update pre-commit requirement from ~=2.20 to ~=2.21 (#7985) 2022-12-26 13:55:03 +00:00
setup.cfg Bump flake8 from 5.0.4 to 6.0.0 (#7859) 2022-12-06 23:23:37 +01:00
tbump.toml
towncrier.toml
tox.ini

`Pylint`_
=========

.. _`Pylint`: https://pylint.pycqa.org/

.. This is used inside the doc to recover the start of the introduction

.. image:: https://github.com/PyCQA/pylint/actions/workflows/tests.yaml/badge.svg?branch=main
    :target: https://github.com/PyCQA/pylint/actions

.. image:: https://coveralls.io/repos/github/PyCQA/pylint/badge.svg?branch=main
    :target: https://coveralls.io/github/PyCQA/pylint?branch=main

.. image:: https://img.shields.io/pypi/v/pylint.svg
    :alt: Pypi Package version
    :target: https://pypi.python.org/pypi/pylint

.. image:: https://readthedocs.org/projects/pylint/badge/?version=latest
    :target: https://pylint.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/ambv/black

.. image:: https://img.shields.io/badge/linting-pylint-yellowgreen
    :target: https://github.com/PyCQA/pylint

.. image:: https://results.pre-commit.ci/badge/github/PyCQA/pylint/main.svg
   :target: https://results.pre-commit.ci/latest/github/PyCQA/pylint/main
   :alt: pre-commit.ci status

.. image:: https://bestpractices.coreinfrastructure.org/projects/6328/badge
   :target: https://bestpractices.coreinfrastructure.org/projects/6328
   :alt: CII Best Practices

.. image:: https://api.securityscorecards.dev/projects/github.com/PyCQA/pylint/badge
   :target: https://api.securityscorecards.dev/projects/github.com/PyCQA/pylint
   :alt: OpenSSF Scorecard

.. image:: https://img.shields.io/discord/825463413634891776.svg
   :target: https://discord.gg/qYxpadCgkx
   :alt: Discord


What is Pylint?
================

Pylint is a `static code analyser`_ for Python 2 or 3. The latest version supports Python
3.7.2 and above.

.. _`static code analyser`: https://en.wikipedia.org/wiki/Static_code_analysis

Pylint analyses your code without actually running it. It checks for errors, enforces a
coding standard, looks for `code smells`_, and can make suggestions about how the code
could be refactored. Pylint can infer actual values from your code using its internal
code representation (astroid). If your code is ``import logging as argparse``, Pylint
will know that ``argparse.error(...)`` is in fact a logging call and not an argparse call.

.. _`code smells`: https://martinfowler.com/bliki/CodeSmell.html

Pylint is highly configurable and permits to write plugins in order to add your
own checks (for example, for internal libraries or an internal rule). Pylint also has an
ecosystem of existing plugins for popular frameworks and third party libraries.

.. note::

    Pylint supports the Python standard library out of the box. Third-party
    libraries are not always supported, so a plugin might be needed. A good place
    to start is ``PyPI`` which often returns a plugin by searching for
    ``pylint <library>``. `pylint-pydantic`_, `pylint-django`_ and
    `pylint-sonarjson`_ are examples of such plugins. More information about plugins
    and how to load them can be found at `plugins`_.

.. _`plugins`: https://pylint.pycqa.org/en/latest/development_guide/how_tos/plugins.html#plugins
.. _`pylint-pydantic`: https://pypi.org/project/pylint-pydantic
.. _`pylint-django`: https://github.com/PyCQA/pylint-django
.. _`pylint-sonarjson`: https://github.com/omegacen/pylint-sonarjson

Pylint isn't smarter than you: it may warn you about things that you have
conscientiously done or check for some things that you don't care about.
During adoption, especially in a legacy project where pylint was never enforced,
it's best to start with the ``--errors-only`` flag, then disable
convention and refactor message with ``--disable=C,R`` and progressively
re-evaluate and re-enable messages as your priorities evolve.

Pylint ships with three additional tools:

- pyreverse_ (standalone tool that generates package and class diagrams.)
- symilar_  (duplicate code finder that is also integrated in pylint)

.. _pyreverse: https://pylint.pycqa.org/en/latest/pyreverse.html
.. _symilar: https://pylint.pycqa.org/en/latest/symilar.html

The epylint_ Emacs package, which includes Flymake support, is now maintained
in `its own repository`_.

.. _epylint: https://pylint.pycqa.org/en/latest/user_guide/ide_integration/flymake-emacs.html
.. _its own repository: https://github.com/emacsorphanage/pylint

Projects that you might want to use alongside pylint include flake8_ (faster and simpler checks
with very few false positives), mypy_, pyright_ or pyre_ (typing checks), bandit_ (security
oriented checks), black_ and isort_ (auto-formatting), autoflake_ (automated removal of
unused imports or variables), pyupgrade_ (automated upgrade to newer python syntax) and
pydocstringformatter_ (automated pep257).

.. _flake8: https://github.com/PyCQA/flake8
.. _bandit: https://github.com/PyCQA/bandit
.. _mypy: https://github.com/python/mypy
.. _pyright: https://github.com/microsoft/pyright
.. _pyre: https://github.com/facebook/pyre-check
.. _black: https://github.com/psf/black
.. _autoflake: https://github.com/myint/autoflake
.. _pyupgrade: https://github.com/asottile/pyupgrade
.. _pydocstringformatter: https://github.com/DanielNoord/pydocstringformatter
.. _isort: https://pycqa.github.io/isort/

.. This is used inside the doc to recover the end of the introduction

Install
-------

.. This is used inside the doc to recover the start of the short text for installation

For command line use, pylint is installed with::

    pip install pylint

It can also be integrated in most editors or IDEs. More information can be found
`in the documentation`_.

.. _in the documentation: https://pylint.pycqa.org/en/latest/user_guide/installation/index.html

.. This is used inside the doc to recover the end of the short text for installation

Contributing
------------

.. This is used inside the doc to recover the start of the short text for contribution

We welcome all forms of contributions such as updates for documentation, new code, checking issues for duplicates or telling us
that we can close them, confirming that issues still exist, `creating issues because
you found a bug or want a feature`_, etc. Everything is much appreciated!

Please follow the `code of conduct`_ and check `the Contributor Guides`_ if you want to
make a code contribution.

.. _creating issues because you found a bug or want a feature: https://pylint.pycqa.org/en/latest/contact.html#bug-reports-feedback
.. _code of conduct: https://github.com/PyCQA/pylint/blob/main/CODE_OF_CONDUCT.md
.. _the Contributor Guides: https://pylint.pycqa.org/en/latest/development_guide/contribute.html

.. This is used inside the doc to recover the end of the short text for contribution

Show your usage
-----------------

You can place this badge in your README to let others know your project uses pylint.

    .. image:: https://img.shields.io/badge/linting-pylint-yellowgreen
        :target: https://github.com/PyCQA/pylint

Learn how to add a badge to your documentation in the `the badge documentation`_.

.. _the badge documentation: https://pylint.pycqa.org/en/latest/user_guide/installation/badge.html

License
-------

pylint is, with a few exceptions listed below, `GPLv2 <https://github.com/PyCQA/pylint/blob/main/LICENSE>`_.

The icon files are licensed under the `CC BY-SA 4.0 <https://creativecommons.org/licenses/by-sa/4.0/>`_ license:

- `doc/logo.png <https://raw.githubusercontent.com/PyCQA/pylint/main/doc/logo.png>`_
- `doc/logo.svg <https://raw.githubusercontent.com/PyCQA/pylint/main/doc/logo.svg>`_

Support
-------

Please check `the contact information`_.

.. _`the contact information`: https://pylint.pycqa.org/en/latest/contact.html

.. |tideliftlogo| image:: https://raw.githubusercontent.com/PyCQA/pylint/main/doc/media/Tidelift_Logos_RGB_Tidelift_Shorthand_On-White.png
   :width: 200
   :alt: Tidelift

.. list-table::
   :widths: 10 100

   * - |tideliftlogo|
     - Professional support for pylint is available as part of the `Tidelift
       Subscription`_.  Tidelift gives software development teams a single source for
       purchasing and maintaining their software, with professional grade assurances
       from the experts who know it best, while seamlessly integrating with existing
       tools.

.. _Tidelift Subscription: https://tidelift.com/subscription/pkg/pypi-pylint?utm_source=pypi-pylint&utm_medium=referral&utm_campaign=readme