NOSONAR is not respected for Python multiline strings

We’re using SonarQube 8.9.1 (build 44547)

It appears that the # NOSONAR comment is ignored for multi-line strings in Python. We’ve tried a range of locations in the multi-line string to no avail, as shown by the attached screenshots.

Using # NOSONAR at the end of the opening triple quoted string (supported by flake8 etc. although becomes part of the string)

Using # NOSONAR at the end of the closing triple quoted string, when the triple quotes are on the same and different lines as the text within them.

Hello @testworksau,

Thank you for reporting this.

Indeed, NOSONAR comments do not seem to be working as intended in the case you describe. I have created the following ticket to fix this.


1 Like