Home » Support » Index of All Documentation » Wing IDE Reference Manual »

14. PyLint Integration

Wing Pro provides a simple integration with pylint, which is a third party tool that runs error and warning analyses on Python code.

To use the tool, you must install pylint separately first. Then bring up the PyLint tool from the Tools menu. Right click on the tool and select Configure. This will open a configuration file in an editor in Wing. You can alter the following here:

  • command -- The command that invokes pylint
  • args -- Additional command line arguments to send to pylint (see the pylint documentation for details on those available)
  • timeout -- The maximum amount of time to wait for pylint to complete before aborting analysis.
  • autosave -- Set this to 1 to automatically save a file before starting pylint to analyze it.

Once you have edited the configuration file as desired, save and close it.

Next, bring up some Python source code in an editor in Wing and then right click on the PyLint tool and select Update. After some time (up to a minute for larger files), lists of errors, warnings, and informational messages will be placed into the tool. Click on the items to bring up the source code with the indicated line selected.

Note that you can disable messages on the command line to pylint, as configured using the args item in the configuration file. See the pylint documentation for details.

Processing multiple files

The context menu on the PyLint tool will include an item for running pylint on all the files in the current package, when the current file is in a package (a directory that contains a file __init__.py). In this case, the file name as well as the line number is shown in the Line column of the output.

Note that this option adds --output-format=parseable to the pylint command line so that the file names can be obtained. This may not work with all pylint versions.

Credits

Thanks to Markus Meyer for providing the original implementation of this capability for Wing IDE. The source code for this integration is available under open source license in scripts/pylintpanel.py within your Wing IDE installation.

« 13.3. Analysis Disk CacheTable of Contents15. Scripting and Extending Wing IDE »