Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore SonarQube warnings in python

How can I ignore SonarQube warnings in Python code

In Java, I can use

@SuppressWarnings("squid:S1166")

Where the ID is the SonarQube rule ID. But what syntax should I use in Python?

I've tried

# noinspection python:S1313

but it didn't work.

To be clear, I'm looking for a solution in python code. NOT JAVA.

like image 570
Daniel Scott Avatar asked Jun 03 '16 08:06

Daniel Scott


1 Answers

I believe the only syntax supported for Python (assuming it is supported) is the NOSONAR comment, so #NOSONAR at the end of the line where you want to ignore issues.

Unfortunately, this is a global issue suppression: it kills all issues on the line, not just those from a specific rule.

like image 161
G. Ann - SonarSource Team Avatar answered Sep 20 '22 14:09

G. Ann - SonarSource Team