简体   繁体   English

如何从 Sonarlint 中的特定文件中排除特定规则

[英]How To Exclude a specific rule from a specific file in Sonarlint

I am trying to exclude a specific rule from a file in sonarlint, I have multiple java automation projects open in eclipse, and I am wondering if my "Value" is correct on my analyzed property that I have set.我试图从 sonarlint 中的文件中排除特定规则,我在 eclipse 中打开了多个 java 自动化项目,我想知道我的“值”在我设置的分析属性上是否正确。 (LN_LexisConveyOnline is the name of the project) I have implemented the below, and nothing seems to change. (LN_LexisConveyOnline 是项目的名称)我已经实现了以下内容,似乎没有任何改变。 Thanks谢谢

My Implementation我的实现

You can do right click over rule, and click in Exclude rule.您可以右键单击规则,然后单击排除规则。 This, in the browser of rules in Eclipse IDE.这在 Eclipse IDE 中的规则浏览器中。

If this is a Java file, you might want to opt for @SuppressWarnings("java:S100") instead or //NOSONAR .如果这是一个 Java 文件,您可能需要选择@SuppressWarnings("java:S100")//NOSONAR

Note that SonarLint (the Eclipse plugin) and Sonar (the server) may not share the same key for the same rule.请注意,SonarLint(Eclipse 插件)和 Sonar(服务器)可能不会为相同的规则共享相同的密钥。 I had at least the problem with issue prefixed by java: and squid: (I presumed this was the old prefix).我至少遇到了以java:squid:为前缀的问题(我认为这是旧前缀)。

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

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