Skip to main content

python code static checker

Project description

https://github.com/PyCQA/pylint/actions/workflows/ci.yaml/badge.svg?branch=master https://coveralls.io/repos/github/PyCQA/pylint/badge.svg?branch=master Pypi Package version Documentation Status https://img.shields.io/badge/code%20style-black-000000.svg

Tidelift

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.

Pylint

It’s not just a linter that annoys you!

Pylint is a Python static code analysis tool which looks for programming errors, helps enforcing a coding standard, sniffs for code smells and offers simple refactoring suggestions.

It’s highly configurable, having special pragmas to control its errors and warnings from within your code, as well as from an extensive configuration file. It is also possible to write your own plugins for adding your own checks or for extending pylint in one way or another.

It’s a free software distributed under the GNU General Public Licence unless otherwise specified.

Development is hosted on GitHub: https://github.com/PyCQA/pylint/

You can use the code-quality@python.org mailing list to discuss about Pylint. Subscribe at https://mail.python.org/mailman/listinfo/code-quality/ or read the archives at https://mail.python.org/pipermail/code-quality/

Pull requests are amazing and most welcome.

Install

Pylint can be simply installed by running:

pip install pylint

If you are using Python 3.6+, upgrade to get full support for your version:

pip install pylint --upgrade

If you want to install from a source distribution, extract the tarball and run the following command

python setup.py install

Do make sure to do the same for astroid, which is used internally by pylint.

For debian and rpm packages, use your usual tools according to your Linux distribution.

More information about installation and available distribution format can be found here.

Documentation

The documentation lives at https://pylint.pycqa.org/.

Pylint is shipped with following additional commands:

  • pyreverse: an UML diagram generator

  • symilar: an independent similarities checker

  • epylint: Emacs and Flymake compatible Pylint

Testing

We use tox and pytest-benchmark for running the test suite. You should be able to install it with:

pip install tox pytest pytest-benchmark

To run the test suite for a particular Python version, you can do:

tox -e py37

To run individual tests with tox, you can do:

tox -e py37 -- -k name_of_the_test

We use pytest for testing pylint, which you can use without using tox for a faster development cycle.

If you want to run tests on a specific portion of the code with pytest, (pytest-cov) and your local python version:

# ( pip install pytest-cov )
# Everything:
python3 -m pytest tests/
# Everything in tests/message with coverage for the relevant code:
python3 -m pytest tests/message/ --cov=pylint.message
coverage html
# Only the functional test "missing_kwoa_py3":
python3 -m pytest "tests/test_functional.py::test_functional[missing_kwoa_py3]"

Do not forget to clone astroid and install the last version:

git clone https://github.com/PyCQA/astroid.git

# From source
python3 astroid/setup.py build sdist
pip3 install astroid/dist/astroid*.tar.gz

# Using an editable installation
cd astroid
python3 -m pip install -e .

For more detailed information, check the documentation.

License

pylint is, with a few exceptions listed below, GPLv2.

The icon files are licensed under the CC BY-SA 4.0 license:

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylint-3.0.0a0.tar.gz (715.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylint-3.0.0a0-py3-none-any.whl (346.3 kB view details)

Uploaded Python 3

File details

Details for the file pylint-3.0.0a0.tar.gz.

File metadata

  • Download URL: pylint-3.0.0a0.tar.gz
  • Upload date:
  • Size: 715.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.9.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.7

File hashes

Hashes for pylint-3.0.0a0.tar.gz
Algorithm Hash digest
SHA256 55ea32972b1fa414d98d2103a0a829859d90de443f361eff413d8c6bf893a0cb
MD5 ec822613a1b26ed4c29609fc7b60119a
BLAKE2b-256 0a90baa93b8e0cc2e38028945b26235593655d1cfd3a1001a13e520c6dbddcea

See more details on using hashes here.

File details

Details for the file pylint-3.0.0a0-py3-none-any.whl.

File metadata

  • Download URL: pylint-3.0.0a0-py3-none-any.whl
  • Upload date:
  • Size: 346.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.9.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.7

File hashes

Hashes for pylint-3.0.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7914560085652c3d42b07350f9afa28b0f52a83766f2b911a6e0cd5822cc7d6
MD5 505008ba512967841de12d551820033f
BLAKE2b-256 fd4c50736f58a3de58805b923b06a395d3e64c744867c2827d956cd123ffea9c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page