1 The Pylint plugin

1.0.1 Description

Pylint is a tool that analyzes Python source code looking for bugs and signs of poor quality. This plugin is responsible for scanning with pylint the python code included in each component in the build and reporting errors and warnings found. It looks for python code under the directory ${srcDir}/src/ where ${srcDir} is specified by the property src.location or, alternatively, under the path specified by the property python.src.location, or alternatively, pylint.src.location. It generates a report (html) with the total number of warnings/errors found for each module/package with a link to the pylint log for that package. It updates the corresponding metrics in the buildstatus.xml file. If a report relative to a module is not readable, it is not included in the report nor it contributes to the metrics value.

1.0.2 Version

  • pylint v. 0.21.4
  • logilab-astng v. 0.20.4
  • logilab-common v. 0.52.1

1.0.3 Homepage

http://www.logilab.org/857

1.1 Activation

1.1.1 Suitability

Suitable for all modules which contain python code.

1.1.2 Execution point

The execution point defines during which command and which target the plugin will be executed.
COMMAND BUILD
TARGET pretest

1.1.3 Profiles

The profiles must be specified in the configuration in order to activate the plugin.

The plugin profile can be used to enable specific plugins.

The bundle profiles can be used to enable a set of plugins within a specific category.

PLUGIN PROFILES pylint
BUNDLE PROFILES  

1.1.4 Deactivation

If this plugin has been activated for a larger set of modules (at project or subsystem level), it is possible to disable it for specific modules using special properties:
NAME nopylint
DESCRIPTION To disable the pylint execution for the current module

NAME notest
DESCRIPTION To disable all the plugins registered at TEST target (PRETEST, TEST, POSTTEST) for the current module

1.2 Input

1.2.1 Required properties

The required properties must be available in order for the plugin to run.

Some of the required properties may have default values which correctness must be check to ensure the correct execution of the plugin.

NAME {python.src.location}
DESCRIPTION Points to the path under which python code is looked for.
DEFAULT VALUE ${src.location}/src
EXAMPLE To have the plugin look for python code under ${src.location}/python, the property must be set as: ${src.location}/python

NAME {pylint.src.location}
DESCRIPTION Points to the path under which python code is looked for. Takes precedence over {python.src.location}.
DEFAULT VALUE|${src.location}/src|
EXAMPLE To have the plugin look for python code under ${src.location}/python, the property must be set as: ${src.location}/python

1.2.2 Other requirements

NONE

1.2.3 Dependencies

logilab-common logilab-astng

1.3 Output

1.3.1 Module reports

For each module, the output is generated in ${src.location}/reports/pylint The plugin generates ${moduleName}-${configuration}/PYLINT-${moduleName}.log.html containing the output of pylint execution.

1.3.2 Global reports

The plugin generates the overall html report index.html with number of warnings and errors found for every module and the corresponding metric value.

1.4 Metrics

1.4.1 Overall

NAME Pylint
VALUE 0.8*errors + 0.2*warnings
UNIT violations
TYPE integer
LINKS HTML: ${workspaceDir}/reports/pylint/index.html
VALUES number of errors(high) and warnings(low)

NAME Pylint rate
VALUE Percentage of modules that have successfully run pylint
UNITS Modules
TYPE Percentage
LINKS HTML: ${workspaceDir}/reports/pylint/index.html
VALUES success: number of successful modules, failed: number of failed modules

1.4.2 Module

The module metrics are related to a single module and provide its plugin execution details.
NAME Pylint
VALUE 0.8*errors + 0.2*warnings
UNIT Violations
TYPE integer
LINKS HTML: ${workspaceDir}/reports/pylint/index.html
VALUES number of errors(high) and warnings(low)

1.5 Advanced

1.5.1 Register

Verifies the existence of pylint. Registers the plugin

1.5.2 Execute

Verifies the existence of user defined properties and analyses python code with pylint.

1.5.3 Publish

Analyses the result of the scan. Feeds metrics into build-status.xml.

1.5.4 Finalise

Generates an overall report and overall metrics.

-- 23-Sep-2011

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r4 - 2011-09-28 - FabioCapanniniExternal
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    EMI All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback