In this section:

Introduction

Parasoft supports Python by integrating with Pylint, an open source static analysis tool for Python source code. Pylint reports issues related to Python programming style and conventions. Refer to the Pylint documentation for a more detailed description: https://github.com/PyCQA/pylint and https://www.pylint.org/.

The Parasoft Pylint extension processes the result file output from your open source static analysis tool, generates reports showing violations and severities for the code authors, and sends the data to Parasoft DTP. DTP presents the data in widgets, reports, and other interfaces that enable you to prioritize violations, place them into remediation workflows, and monitor progress toward improving the code quality. 

Requirements

  • Pylint version 2.11.1 is currently supported.
  • Supported operating systems: Windows, Linux
  • The JAVA_HOME environment variable must be set and pointing to your Java installation folder.
  • Pylint should be installed and successfully running analysis in the Pylint project directory.
  • Pylint should produce reports in the JSON format. Use the --output-format=json parameter during Pylint execution to specify JSON output. Example:

    pylint --output-format=json sampleProjectFolder > c:\sample\pylint-results.json

Usage

  1. If you have not already done so, execute Pylint and verify that the results are output to a file in JSON format.
  2. Open a command prompt and navigate to the Multi-Language Pack installation directory.
  3. Execute the multilanguage-pack.bat or multilanguage-pack.sh script with the required parameters all on one line, e.g.:
multilanguage-pack.bat -tool Pylint -results.file "c:\sample\pylint-results.json" -source.dir "C:\sample\sampleProjectFolder"

Internal technical log files from the Multi-Language Pack execution are generated in the <INSTALL>/.mlp subdirectory.

Required Parameters

The following settings are required.

tool

This setting specifies the Parasoft extension to execute. Use -tool Pylint to run the Pylint extension.

results

Specifies the path to the Pylint analysis results file. 

source.dir

Specifies the path to the folder containing the analyzed Pylint source code. This is used to collect source control metadata (e.g., authorship, last updated, etc.) for DTP reporting and processing.

  • No labels