2.10. sonar_scanner module

GNAThub plug-in for the SonarQube Scanner command-line tool.

It exports the SonarScanner class which implements the GNAThub.Plugin interface. This allows GNAThub’s plug-in runner to automatically find this module and load it as part of the GNAThub default execution.

class sonar_scanner.SonarScanner[source]

Bases: Plugin, Reporter

SonarQube Scanner plugin for GNAThub.

__init__()[source]

Initialize instance properties.

property name

Return the name of the tool.

Returns:

the tool name

Return type:

str

report()[source]

Execute the SonarQube Scanner.

Returns according to the successful of the analysis:

  • GNAThub.EXEC_SUCCESS: on successful execution and analysis

  • GNAThub.EXEC_FAILURE: on any error

setup()[source]

Called prior to a call to Plugin.execute().

This is where environment setup should be done to ensure a correct execution of the tool.