![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A Pylint plugin for checking for use of the print()
function in Python.
The best way to install Pylint Print is to use pip as follows:
pip install pylint-print
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
print
usageprint
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:
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
View on PyPi
FAQs
Print function checker for PyLint
We found that pylint-print demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.