If you are using pre-commit, you do not need to follow these steps. pre-commit runs Pylint for you. We highly recommend using pre-commit. For more information, check out this page: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code

Now that you've installed Pylint and downloaded the .pylintrc configuration file, you're ready to start linting. First thing we need is an example to check.

Download pylint_example.py using the "pylint_example.py" link below. Then, place the file in the same location as your recently downloaded .pylintrc file.

Temporarily unable to load content:

Pylint looks in a series of locations in order to find the configuration file. The first place it looks is the current working directory. This is the easiest way to ensure you're using the right configuration file.

Return to your terminal program or command line. From the command line, navigate to the folder containing pylint_example.py and .pylintrc. Then, run the following command:

pylint pylint_example.py

Alright! Your first error! Consider it a badge of honor. And don't worry! The next section will walk through how to read the Pylint output with a series of common errors. Time to start linting!

This guide was first published on Aug 23, 2019. It was last updated on Mar 27, 2024.

This page (Run Pylint) was last updated on Mar 27, 2024.

Text editor powered by tinymce.