Ignore SonarQube warnings in python

和自甴很熟 提交于 2020-08-27 04:00:11

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/37609940/ignore-sonarqube-warnings-in-python

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!