Nerd Alert: Setting up pylint as a Build Tool in Geany

Setup: I’m using the Geany IDE on an Ubuntu system. For this tip, I am just focusing on Python3 files. I can already automagically execute my scripts without leaving the Geany IDE with “Build Execute“, which I is already set up to F5.

What I want: I want to be able to run a pylint scan on my files inside of Geany.

How to:

  • Install pylint using pip3
    • from the command line: pip3 install pylint
    • test the installation from the command line: python -m pylint sample1.py
  • Configure Geany to use pylint
    • In Geany, have the file type set to Python by having a .py file open in the editor or choosing the file type manually with the “Document ⇒ Set Filetype ...” menu
    • Choose “Build ⇒ Set Build Commands” Choose one of the Python Command buttons. In my case, the second button was empty. I selected it and entered the “Pylint” menu item label.
    • Update for Ubuntu 22.04. I had a typo in the original post. The actual command to add into the build tools is python3 -m pylint "%f" This is the same command that should have been tested above. Here the %f is added for Geany and indicates the current file.
    • Once doing this, I have Pylint show up under the Tools menu with a keyboard shortcut already assigned:
This entry was posted in computers/programming, Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *