简体   繁体   English

忽略python中的SonarQube警告

[英]Ignore SonarQube warnings in python

How can I ignore SonarQube warnings in Python code 如何在Python代码中忽略SonarQube警告

In Java, I can use 在Java中,我可以使用

@SuppressWarnings("squid:S1166")

Where the ID is the SonarQube rule ID. ID是SonarQube规则ID的位置。 But what syntax should I use in Python? 但是我应该在Python中使用什么语法?

I've tried 我试过了

# noinspection python:S1313

but it didn't work. 但它不起作用。

To be clear, I'm looking for a solution in python code. 要清楚,我正在寻找python代码的解决方案。 NOT JAVA. 不是JAVA。

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. 我相信Python支持的唯一语法(假设它受支持的)是NOSONAR注释,所以#NOSONAR在你要忽略问题的行的末尾。

Unfortunately, this is a global issue suppression: it kills all issues on the line, not just those from a specific rule. 不幸的是,这是一个全球性的问题抑制:它会杀死所有问题,而不仅仅是来自特定规则的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM