Python

Supported Versions

  • Python 3.X
  • Python 2.X

Language-Specific Properties

Discover and update the Python-specific Administration > General Settings > Python.

Pylint

Pylint is an external static source code analyzer, it can be used in conjunction with SonarPython.

You can enable Pylint rules directly in your Python Quality Profile. Their rule keys start with "Pylint:".

Once the rules are activated you should run Pylint and import its report:

pylint <module_or_package> -r n --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" > <report_file>

Then pass the generated report path to analysis via the sonar.python.pylint.reportPath property.

Related Pages