Start FreeLog in
SonarCloud | Advanced setup | Languages | Python

Python

On this page

Language-specific properties

Discover and update the Python-specific properties in the project Administration > General Settings > LanguagesPython.

Handling project python version

Python code is analyzed by default as compatible with python 2 and python 3. Some issues will be automatically silenced to avoid raising False Positives. In order to get a more precise analysis you can specify the python versions your code supports via the sonar.python.version parameter.

Accepted format are a comma separated list of versions having the format "X.Y"

Examples:

  • sonar.python.version=2.7
  • sonar.python.version=3.8
  • sonar.python.version=2.7, 3.7, 3.8, 3.9

Jupyter Notebooks

Jupyter Notebooks are an open document format based on JSON. They are used for all sorts of data science tasks: data cleaning and transformation, data visualization, statistical modeling, machine learning, deep learning, etc.

Supported versions

SonarCloud can analyze Jupyter Notebooks nbformat.v4 and later.

Specific properties

Discover and update the Jupyter Notebooks-specific properties in Administration > General Settings > Languages > Python > Jupyter Notebooks.

Managing rules

Jupyter Notebook rules can be enabled and disabled in your quality profile

Jupyter Notebooks in SonarLint for VSCode

You can analyze your Jupyter Notebooks projects directly in VS Code. Note that Connected Mode will be ignored when working with Jupyter Notebooks (if this feature is important to you, you can submit the idea on SonarCloud's portal).

Important notes

  • Only Python code is analyzed in Jupyter Notebooks.
  • Only primary locations are shown (see Issues to learn more about primary vs secondary locations).
  • Analysis does not measure code duplication at this time.

Was this page helpful?

© 2008-2024 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARLINT, SONARQUBE, SONARCLOUD, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License