Pylint
Sign in to savePylint is a static code analysis tool for the Python programming language. It is named following a common convention in Python of a "py" prefix, and a nod to the C programming lint program. It follows the style recommended by PEP 8, the Python style guide. It is similar to Pychecker and Pyflakes, but includes the following features: Checking the length of each line Checking that variable names are well-formed according to the project's coding standard Checking that declared interfaces are truly implemented.
Source code
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. .. This is used inside the doc to recover the start of the short text for installation .. This is used inside the doc to recover the end of the short text for installation Pylint is not trusting your typing and is inferring the actual values of nodes (for a start because there was no typing when pylint started off) using its internal code representation (astroid). If your code is import logging as argparse , Pylint can check and know that argparse.error(...) is in fact a logging call and not an argparse call. This makes pylint slower, but it also lets pylint find more issues if your code is not fully typed. [inference] is the killer feature that keeps us using [pylint] in our project despite how painfully slow it is. Realist pylint user , 2022 pylint, not afraid of being a little slower than it already is, is also a lot more thorough than other linters. There are more checks, including some opinionated ones that are deactivated by default but can be enabled using configuration. 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 messages with --disable=C,R and progressively re-evaluate and re-enable messages as your priorities evolve. 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. Projects that you might want to use alongside pylint include ruff ( really fast, with builtin auto-fix and a large number of checks taken from popular linters, but implemented in rust ) or flake8 (a framework to implement your own checks in python using ast directly), mypy , pyright / pylance 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). Pylint ships with two additional tools: pyreverse (standalone tool that generates package and class diagrams.) symilar (duplicate code finder that is also integrated in pylint) .. 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. .. This is used inside the doc to recover the end of the short text for contribution You can place this badge in your README to let others know your project uses pylint. The icon files are licensed under the CC BY-SA 4.0 license: doc/logo.png doc/logo.svg .. 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.
Excerpt from the source-code README · 9,720 chars · not written by Vinony
~1 min read
Encyclopedic overview
2 sectionsContents
- References
- External links
Pylint is a static code analysis tool for the Python programming language. It is named following a common convention in Python of a "py" prefix, and a nod to the C programming lint program. It follows the style recommended by PEP 8, the Python style guide. It is similar to Pychecker and Pyflakes, but includes the following features: Checking the length of each line Checking that variable names are well-formed according to the project's coding standard Checking that declared interfaces are truly implemented.
It is also equipped with the Pyreverse module that allows UML diagrams to be generated from Python code.
Excerpted from Wikipedia’s “Pylint” article, available under the CC BY-SA 4.0 licence.