This project has been archived by its maintainers, and is no longer receiving any updates.
Pylint Print Checker
A Pylint plugin for checking for use of the print() function in Python.
Installation
The best way to install Pylint Print is to use pip as follows:
pip install pylint-print
Example Usage
This simple program is saved as hello_world.py:
"""
a module to demonstrate the pylint-print checker
"""
if __name__ == "__main__":
print("Hello, World!")
In order to use pylint-print, this must be included as a plug in there are two main ways to do this. The first method is to use the command line options:
pylint hello_world.py --load-plugins=pylint_print
This will provide a response that should look like this:
************* Module hello_world
hello_world.py:6:4: W8201: Logging should be used instead of the print() function. (print-function)
-----------------------------------
Your code has been rated at 5.00/10
The other main way to use pylint is with a configuration file. Refer to the Pylint Documentation for more details about the configuration files and how to set one up.
The configuration file should have a load-plugin key which will need the pylint_print added
as follows:
# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
load-plugins=pylint_print
Once the plugin has been added to the configuration file it is no long necessary to add it to the
pylint execution, for example:
pylint hello_world.py
Why warn about print usage
print statements are often the first thing a developer learns, they are useful to add to your
code when developing to understand how it works and debug problems.
However, as a project grows they can become problematic, it is much better to use a logger that allows:
- Log messages to be filtered by type or module
- Log messages can be redirected to other places rather than the console e.g. a file
For these reasons some projects may want to restrict the usage of print in their coding rules
and make a check as part of the linting checks to avoid needing manual reviews
Further Information
View on PyPi
Metadata
Release files for pylint-print 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pylint-print-1.0.1.tar.gz | 3.8 kB | Without provenance | Details for pylint-print-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pylint_print-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for pylint_print-1.0.1-py3-none-any.whl |
Total release size: 7.5 kB
Release files / pylint-print-1.0.1.tar.gz
| Download URL | pylint-print-1.0.1.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30aa207e9718ebf4ceb47fb87012092e6d8743aab932aa07aa14a73e750ad3d0
|
|
BLAKE2b-256 checksum How to use checksums |
60768fd24bfcbd5130b487990c6ec5eab2a053f1ec8f7d33ef6c38fee7e22b70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.15
|
Release files / pylint_print-1.0.1-py3-none-any.whl
| Download URL | pylint_print-1.0.1-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a2b2599e7887b93e551db2624c523c1e6e9e58c3be8416cd98d41e4427e2669b
|
|
BLAKE2b-256 checksum How to use checksums |
8fa96f0687b575d502b4fa770cd52231e23462c548829e5f2e6f43a3d2b9c939
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.15
|
Security for pylint-print 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.