With all of my analyses, I now get the warning message:
"Your code is analyzed as compatible with python 2 and 3 by default. This will prevent the detection of issues specific to python 2 or python 3. You can get a more precise analysis by setting a python version in your configuration via the parameter “sonar.python.version”
I reviewed this ticket but it isn’t clear to me how to set the Python version for the property sonar.python.version in the Sonarcloud UI.
If you are using a CI-based analysis then you would do the same except in a file called sonar-project.properties or on the command line of the scanner.
# in .sonarcloud.properties
sonar.python.version=3
# in .sonarcloud.properties
sonar.python.version=3.9
# in sonar-project.properties
sonar.python.version=3
None of these seems to work – we’re still getting the warning in SonarCloud console.
In the former case, you would put this property declaration in the file .sonarcloud.properties. In the latter case, you would put it in sonar-project.properties.