MYPY Report Not Working

Hi all,

I wanted to use Mypy report in my sonarcloud, after i configure Mypy i can’t see sonarcloud show the report of Mypy.

My setup as below:


$ mypy --strict --linecoverage-report=coverage-reports . error: Function is missing a return type annotation  [no-untyped-def] error: Function is missing a type annotation  [no-untyped-def] error: Function is missing a return type annotation  [no-untyped-def] error: Call to untyped function "url_google" in typed context  [no-untyped-call]
Found 4 errors in 2 files (checked 4 source files)


exclude = (?x)(^test_*)


Sonarcloud - External Analyzers

But above error that i got after generating mypy, it didn’t show in Sonarcloud,
Kindly assit.

Hey there.

sonar.python.mypy.reportPaths is expecting an issue report, not a coverage report. As the mypy docs say:

–linecoverage-report DI(The mypy command line - mypy 1.2.0 documentation)

Causes mypy to generate a JSON file that maps each source file’s absolute filename to a list of line numbers that belong to typed functions in that file.

The file you pass to the analysis parameter should look more like this, which is not a JSON file.


Thank you @\Colin,
working fine now, thank you for your reference. :smiley:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.